Robot modelling, full course

← Robot list · 3D robot arm →

The complete course on modelling a serial manipulator robot (Master level), explained step by step: orientation, homogeneous matrices, DHm, direct and inverse geometric models, Jacobian, motion laws, dynamics and control. Read the “Maths and motion” course first if you are a beginner.

The logic of the module in one sentence

A serial robot is a chain of solids linked by motorised joints. To model this robot is to know how to go from the values of the motors q = (q1, …, qn) (joint space) to the position and orientation of the tool X (operational space), and conversely:

MGDMGIKinematic modelMotion laws
X = f(q)q = f−1(X)X˙ = J(q) q˙q(t), q˙(t)

The whole course consists in building these relations step by step.

1–2345–678910
OrientationHomogeneous matricesDHm parametersMGD / MGISpaces and aspectsJacobian (speeds)Motion lawsDynamics and control

Basic vocabulary

1

Locating an object: position and rotation matrix

10 min
You will learn

what “locating” an object means, and the rotation matrix with its properties.

Already met the basics?

Lessons 1 to 4 start from scratch but go fast. If rotations, frames or DH are new to you, first read the lessons of “The maths of robotics” (4, 5, 6 to 8 and 11): they explain each idea slowly, with exercises. This course then goes further: the Khalil–Kleinfinger notation, the extraction of Euler and Cardan angles, the full SCARA and 6-axis examples.

Go to the maths course →

1.1 What “locating” means

Locating an object in space is giving two pieces of information relative to a reference frame R0 attached to the environment:

  1. the position of a particular point of the object (centre of gravity, corner, tool centre…): 3 coordinates (x, y, z) in R0;
  2. the orientation of the object: 3 angles which characterise in a unique way the orientation of the frame R1 linked to the object relative to R0.

Result: 6 parameters (6 DOF) for a free solid.

1.2 The rotation matrix

Let R1 = (O, x1, y1, z1) be turned relative to R0 = (O, x0, y0, z0). The columns of the rotation matrix 0R1 are the vectors of R1 expressed in R0 (direction cosines):

0R1 = x1·x0y1·x0z1·x0x1·y0y1·y0z1·y0x1·z0y1·z0z1·z0 = r11r12r13r21r22r23r31r32r33, 0OP = 0R1 1OP

The left exponent tells in which frame the coordinates are written. 0R1 gives the old coordinates (in R0) as a function of the new ones (in R1).

Remember: properties of a rotation matrix
  • It is orthogonal: 0R1−1 = 0R1T = 1R0 (the inverse is computed by a simple transposition).
  • det R = +1; each column (and each row) is a unit vector; two columns are orthogonal.
  • Composition: 0R2 = 0R1 1R2 (the indices “chain together”).

1.3 The three elementary rotations

Rot(x, θ) = 1000cos θ−sin θ0sin θcos θ
Rot(y, θ) = cos θ0sin θ010−sin θ0cos θ
Rot(z, θ) = cos θ−sin θ0sin θcos θ0001

Mnemonic: the row and the column of the rotation axis contain a 1 and zeros; the “−sin” is above the diagonal for x and z, but below it for y (circular order x → y → z → x: for y, we turn from z towards x).

Solved exercise (Master course): rotation of a point

R1 is obtained by Rot(z, 45°) and 1p = (−2, 1, 0)T. Compute 0p.

Solution. 0p = Rot(z, 45°) 1p with cos 45° = sin 45° = √2/2:

0p = (√2/2)(−2) − (√2/2)(1)(√2/2)(−2) + (√2/2)(1)0 = −3√2/2−√2/20 ≈ −2.121−0.7070

Check: the norm is conserved, √(4.5 + 0.5) = √5 = ‖1p‖. ✓

Each basic rotation keeps one axis fixed (thick) and turns the two others by θ (dashed: before, solid: after). The orange arrow shows the positive direction (right hand, thumb along the axis).

Key terms

  • reference frame
  • rotation matrix
  • direction cosines
  • orthogonal matrix
The essentials
  • The position of a point is a vector (x, y, z) in a frame.
  • The orientation of a body is a 3 × 3 rotation matrix R: its columns are the axes of the body written in the reference frame.
  • R is orthonormal: Rᵀ R = I, so the inverse of R is simply its transpose; det R = +1.
A body is located by a position p and a rotation matrix R whose columns are its own axes written in the reference frame.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

Rotation of 90° about z. Where does the x axis go? Give its y component.

Solution

R_z(90°) = ( 0 −1 0 ; 1 0 0 ; 0 0 1 ). Its first column (0, 1, 0) is the new x axis: it points along the old y, so the y component is 1.

Level 2 · Intermediate2

What is the determinant of any rotation matrix?

Solution

+1. A determinant of −1 would mean a mirror (a left hand becomes a right hand), which is not a rotation.

Level 3 · Professional3

R turns the frame by 30° about z. Which matrix brings it back?

  1. Rᵀ (the transpose), which is R_z(−30°).
  2. −R.
  3. R × R.

Solution

For a rotation, R⁻¹ = Rᵀ. Transposing R_z(30°) changes the sign of the sin terms, which is exactly R_z(−30°).

Check yourself
  1. What is the inverse of a rotation matrix?

    Its transpose: R−1 = RT.

  2. What does the left exponent in 0R1 mean?

    The frame in which the coordinates are expressed (R0).

  3. The columns of a rotation matrix are…

    1. the unit axes of the new frame, seen in the old one
    2. random numbers

    Each column is a unit vector and they are perpendicular.

2

Describing the orientation with 3 angles: Euler and Cardan

15 min
You will learn

the two conventions of 3 angles, how to compute the matrix, and how to get the angles back.

A rotation matrix contains 9 numbers but only 3 are independent. We therefore describe the orientation with 3 angles, by chaining 3 elementary rotations. Two conventions are on the programme.

2.1 Euler angles (ZXZ convention): rotations around moving axes

We start from the frame A and perform successively:

  1. a rotation of angle φ (precession) around z: x becomes u;
  2. a rotation of angle θ (nutation) around the new axis x (= u): z becomes z′;
  3. a rotation of angle ψ (proper rotation) around the new axis z′: we obtain the frame B.

The rotation axes move with the frame: we multiply on the right, in the order of the rotations.

ARB = REuler = Rot(z, φ) Rot(x, θ) Rot(z, ψ) = cφcψ − sφcθsψ−cφsψ − sφcθcψsφsθsφcψ + cφcθsψ−sφsψ + cφcθcψ−cφsθsθsψsθcψcθ

with cφ = cos φ, sφ = sin φ, etc. Usual domains: φ ∈ [0, 2π[, θ ∈ [0, π], ψ ∈ [0, 2π[.

Euler angles (ZXZ): each rotation is done around an axis of the frame obtained so far (grey dashed: before; in colour: after). The product is Rot(z, φ) Rot(x, θ) Rot(z, ψ), multiplied on the right.

2.2 Cardan angles / Roll–Pitch–Yaw (XYZ fixed convention)

This time we turn around the fixed axes of space (a rotation does not modify the direction of the next one). It is the convention of free vehicles in space: drones, boats, mobile robots. Vocabulary from navigation:

  • x forward, z vertical towards the sky, y to the left (right-handed frame);
  • roll γ around x, pitch β around y, yaw α around z.

The first rotation (around x) is done on the object; the following ones are “added” on the left:

ARB = RCardan = Rot(z, α) Rot(y, β) Rot(x, γ) = cαcβcαsβsγ − sαcγcαsβcγ + sαsγsαcβsαsβsγ + cαcγsαsβcγ − cαsγ−sβcβsγcβcγ

Remember: the order of the multiplications
  • Rotations around the axes of the moving frame (Euler): we multiply on the right (R = R1R2R3, in chronological order).
  • Rotations around the axes of the fixed frame (Cardan): we multiply on the left (R = R3R2R1).
  • Useful remark: Rot(z, α) Rot(y, β) Rot(x, γ) can be read either as x then y then z around the fixed axes, or as z then y′ then x″ around the moving axes: it is the same matrix.
  • The matrix product is not commutative: changing the order changes the final orientation.
Roll–pitch–yaw: three turns, each around an axis of the frame obtained so far (grey dashed: before; in colour: after). When the pitch reaches 90°, the roll axis lies on the yaw axis: two angles describe the same motion.

2.3 Inverse problem: finding the angles from the matrix

We know ARB = (rij) and look for the Cardan angles (α, β, γ). We identify term by term.

Method: extraction of the Cardan angles
  1. r31 = −sin β and r11² + r21² = cos² β, so cos β = ±√(r11² + r21²).
  2. Regular case cos β ≠ 0 (two solutions): β = atan2(−r31, ±√(r11² + r21²)), α = atan2(r21/cβ, r11/cβ), γ = atan2(r32/cβ, r33/cβ).
  3. Singular case cos β = 0: if β = +π/2, only the difference γ − α is defined: γ − α = atan2(r12, r22); one possible solution: α = 0, γ = atan2(r12, r22). If β = −π/2, only the sum γ + α is defined: γ + α = atan2(−r12, r22); one possible solution: α = 0, γ = atan2(−r12, r22).

Why atan2(y, x) and not arctan(y/x)? Because atan2 uses the signs of y and of x to give the angle in the right quadrant (]−π, π]), whereas arctan only returns an angle between −π/2 and π/2.

Classic pitfall

In the singular case (gimbal lock), two rotation axes are aligned: we lose one degree of freedom of the representation and there are infinitely many solutions. Never divide by cos β = 0!

Key terms

  • Euler angles
  • Cardan / roll–pitch–yaw
  • gimbal lock
  • atan2
The essentials
  • Three angles are enough to describe any orientation (but 9 numbers are in R).
  • Euler (Z-Y-Z) or Cardan / roll-pitch-yaw (Z-Y-X): the order of the rotations matters.
  • At some angles two axes line up and one angle is lost: that is gimbal lock.
Roll–pitch–yaw (Z-Y-X): three turns in a fixed order. Change the order and you get another orientation; at pitch ±90° two axes line up (gimbal lock).

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

How many angles describe an orientation in 3D?

Solution

3 (for example roll, pitch and yaw).

Level 2 · Intermediate2

Do "30° about x, then 90° about y" and "90° about y, then 30° about x" give the same orientation?

  1. No: rotations in 3D do not commute.
  2. Yes, always.

Solution

Try with a book: the final orientation is different. That is why every convention fixes the order of the three rotations.

Level 3 · Professional3

With roll-pitch-yaw (Z-Y-X), which pitch angle (in degrees, positive) causes gimbal lock?

Solution

At pitch = 90°, the first and third rotation axes become parallel: yaw and roll do the same thing, one degree of freedom is lost.

Check yourself
  1. Euler (moving axes) or Cardan (fixed axes): on which side do you multiply the new rotation?

    Euler: on the right. Cardan: on the left.

  2. When is the extraction of the Cardan angles singular?

    When cos β = 0, that is β = ±π/2 (gimbal lock).

  3. How many angles describe an orientation (Euler or Cardan)?

    1. 3
    2. 2
    3. 9

    3 angles, even if the matrix has 9 numbers.

Axis-angle and quaternions, the representations used by ROS 2 →

3

Homogeneous transformation matrices

12 min
You will learn

a single 4×4 tool for rotation and translation, composition and inverse.

3.1 The idea: one tool for the rotation and the translation

In robotics, a frame Rj is both turned and moved relative to Ri. We group both pieces of information in a 4 × 4 matrix:

iTj = ( iRj | iPj ; 0 0 0 | 1 ) = sxnxaxPxsynyayPysznzazPz0001

  • the 3×3 block is the rotation matrix (without rotation: the identity);
  • the 4th column contains the coordinates of the origin Oj in Ri;
  • the last row is always (0 0 0 1).

The columns s, n, a are the vectors xj, yj, zj expressed in Ri (Khalil–Dombre notation).

3.2 Homogeneous coordinates of a point, homogeneous components of a vector

Remember

We add a 4th component:

  • for a point: 1, iP = (x, y, z, 1)T ⟹ the translation applies;
  • for a vector: 0, iV = (α, β, γ, 0)T ⟹ the translation does not apply (a free vector does not “translate”).

In both cases: 0P = 0T1 1P and 0V = 0T1 1V.

3.3 Elementary transformations

Trans(a, b, c) = 100a010b001c0001 Rot(x, θ) = 10000cos θ−sin θ00sin θcos θ00001

Applied to a point: Trans(a, b, c) (x, y, z, 1)T = (x+a, y+b, z+c, 1)T; applied to a vector, it leaves it unchanged.

3.4 Composition and inverse

0Tn = 0T1 1T2 2T3 … n−1Tn jTi = (iTj)−1 = ( iRjT −iRjT iPj ; 0 0 0 | 1 )

The global transformation of a 6-axis robot is therefore 0T6 = 0T1 1T2 2T3 3T4 4T5 5T6: it allows to express in the base frame R0 any point or vector known in the frame of the end effector R6.

Solved exercise 1 of course C2: homogeneous coordinates and components
  1. Homogeneous coordinates in R0 of O0: 0O0 = (0, 0, 0, 1)T.
  2. Homogeneous components in R0 of z0: 0z0 = (0, 0, 1, 0)T.
  3. In R1, 1O1 = (0, 0, 0, 1)T. Then 0O1 = 0T1 (0, 0, 0, 1)T = 4th column of 0T1: only the position vector (Px, Py, Pz) is needed.
  4. In R1, 1z1 = (0, 0, 1, 0)T. Then 0z1 = 0T1 (0, 0, 1, 0)T = 3rd column of 0T1: the vector a.
  5. The TCP is at d = +20 cm from the flange along z6: 6TCP = (0, 0, 0.2, 1)T (in m), hence 0TCP = 0T6 6TCP = (Px + 0.2 ax, Py + 0.2 ay, Pz + 0.2 az, 1)T. We only need the 3rd and 4th columns of 0T6.
Solved exercise (Master course): chain of frames

We know UTA, ATB, UTC and CTD and we look for BTD (how to see object D from B).

Solution. We write a “path” from B to D through the known frames, by inverting the arrows that we go through backwards:

BTD = BTA ATU UTC CTD = (ATB)−1 (UTA)−1 UTC CTD

Rule: the adjacent indices must “touch each other” (BTA ATU …).

The 2-axis arm of the worked example with its three frames. ⁰T₁ takes frame 0 to frame 1, ¹T₂ takes frame 1 to frame 2; their product ⁰T₂ goes straight from the base to the tool.

Key terms

  • homogeneous matrix
  • homogeneous coordinates
  • composition
  • inverse transformation
The essentials
  • T = ( R p ; 0 0 0 1 ) puts the rotation R and the position p in one 4 × 4 matrix.
  • A point is written (x, y, z, 1); then p₀ = T₀₁ p₁ in one multiplication.
  • Chaining: T₀₂ = T₀₁ T₁₂. Inverse: T⁻¹ = ( Rᵀ −Rᵀp ; 0 1 ).
Homogeneous transforms chain like arrows: going from frame 0 to frame 2 is going from 0 to 1, then from 1 to 2.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

Size of a homogeneous transformation matrix in 3D?

  1. 4 × 4
  2. 3 × 3
  3. 6 × 6

Solution

4 × 4: a 3 × 3 rotation, a 3 × 1 position, and the line (0 0 0 1).

Level 2 · Intermediate2

T₀₁: no rotation, p = (1, 2, 0). Point (0.5, 0, 0) in frame 1. Its y in frame 0?

Solution

Without rotation, p₀ = p + p₁ = (1 + 0.5, 2 + 0, 0) = (1.5, 2, 0).

Level 3 · Professional3

T₀₁: rotation of 90° about z and p = (1, 0, 0). The point (1, 0, 0) of frame 1: its x in frame 0?

Hint

First R × (1, 0, 0), then add p.

Solution

R_z(90°) × (1, 0, 0) = (0, 1, 0). Add p: (0 + 1, 1 + 0, 0) = (1, 1, 0).

Check yourself
  1. In a 4×4 homogeneous matrix, what does the last row always contain?

    (0 0 0 1).

  2. What is the 4th component of a point? Of a vector?

    1 for a point (the translation applies), 0 for a vector (it does not).

  3. A homogeneous matrix 4×4 contains…

    1. a rotation and a translation
    2. only a rotation

    3×3 rotation + 3×1 translation + the row (0 0 0 1).

4

Placing the frames: the modified Denavit–Hartenberg convention (DHm)

25 min
You will learn

the rules to place the frames, the 4 parameters, the transition matrix and full examples (SCARA, Kuka, ABB, UR3).

4.1 Why a convention?

There are infinitely many ways of placing a frame on each body. The DHm method (Khalil–Kleinfinger) imposes rules which allow describing a chain of n bodies with a minimal number of parameters: each passage Rj−1 → Rj only requires 4 parameters (instead of 6).

Notation: the body Cj carries the frame Rj; the joint Lj links Cj−1 to Cj; C0 is the base.

4.2 The rules to place the frames

Method: placing the frame Rj on the body Cj
  1. Axis zj: carried by the axis of the joint Lj (rotation axis of a pivot, direction of translation of a slider).
  2. Axis xj: carried by the common perpendicular to zj and zj+1. If the axes are concurrent, xj is normal to the plane they form.
  3. Origin Oj: at the intersection of zj and xj.
  4. Axis yj: completes so that (xj, yj, zj) is a right-handed orthonormal frame.

Advised order: place first all the z, then all the x, then the y and the origins.

The common perpendicular between two lines:

  • two arbitrary (non-coplanar) lines: it is unique;
  • two concurrent lines: it is unique (normal to the plane, through the intersection point);
  • two parallel lines: infinitely many solutions (parallel to each other, of variable height) ⇒ we choose the one that cancels a maximum of parameters;
  • two coincident lines: double infinity of solutions (free height and orientation).

Conventions for the ends: we choose R0 coincident with R1 when q1 = 0 (often z0 vertical, O0 at the base); for the last frame Rn, we choose xn coincident with xn−1 when qn = 0, or on a symmetry axis of the end effector.

The same arm with all the frames of modified DH and the numbers of its table: each zⱼ on joint j itself, each xⱼ from zⱼ to zⱼ₊₁, frames 1 and 2 at the shoulder, frame E on the tool.

4.3 The 4 parameters to go from Rj−1 to Rj

Modified DH (Khalil letters), row j: α and d are measured on xⱼ₋₁ (between zⱼ₋₁ and zⱼ), θ and r on zⱼ (between xⱼ₋₁ and xⱼ). Dashed: an axis moved parallel to itself, to show the angle.
Param.Definition
αjangle between zj−1 and zj, measured around xj−1
djdistance between zj−1 and zj, measured along xj−1
θjangle between xj−1 and xj, measured around zj
rjdistance between xj−1 and xj, measured along zj
σjtype of joint: σj = 0 pivot, σj = 1 slider

(In the Master 2016 course, dj is written aj: it is the same parameter.)

Remember
  • αj and dj are always constant (dimensional parameters of the robot).
  • Pivot joint (σj = 0): the joint variable is qj = θj; rj is constant.
  • Slider joint (σj = 1): the joint variable is qj = rj; θj is constant.
  • In short: qj = σ̄j θj + σj rj with σ̄j = 1 − σj.
  • For a robot with n DOF: 5n parameters, arranged in the Denavit–Hartenberg table.

4.4 The transition matrix j−1Tj

We chain 4 elementary movements (in this order):

j−1Tj = Rot(x, αj) Trans(x, dj) Rot(z, θj) Trans(z, rj)

j−1Tj = cos θj−sin θj0djcos αj sin θjcos αj cos θj−sin αj−rj sin αjsin αj sin θjsin αj cos θjcos αjrj cos αj0001

Frequent cases to know by heart:

  • αj = 0 (parallel axes): j−1Tj = cθj−sθj0djsθjcθj00001rj0001
  • αj = −π/2: the 2nd row becomes (0 0 1 rj) and the 3rd (−sθj −cθj 0 0).
  • αj = +π/2: the 2nd row becomes (0 0 −1 −rj) and the 3rd (sθj cθj 0 0).

4.5 A complete example: the SCARA robot (4 DOF, RRPR)

The SCARA has 4 moving bodies + the base, so 5 frames R0 … R4. Joints: pivot q1, pivot q2, slider q3 (vertical), pivot q4 (rotation of the tool). The four z axes are vertical and parallel.

jσjαjdjθjrj
1000q1r1
200d2q20
310d30q3
4000q4−r4

4 joint variables (q1, q2, q3, q4) and 4 non-zero dimensional parameters (r1, d2, d3, r4). The sign −r4 comes from O4 being lower than O3; q3 is counted along z3.

The 4 matrices:

0T1 = c1−s100s1c100001r10001 1T2 = c2−s20d2s2c20000100001

2T3 = 100d30100001q30001 3T4 = c4−s400s4c400001−r40001

Calculation trick: we multiply starting from the end, 2T4 = 2T3 3T4, then 1T4 = 1T2 2T4, then 0T4 = 0T1 1T4. We write c12 = cos(q1+q2), c124 = cos(q1+q2+q4), etc. Result:

0T4 = c124−s1240d2c1 + d3c12s124c1240d2s1 + d3s12001r1 + q3 − r40001

Interpretation: the tool turns by an angle q1 + q2 + q4 around the vertical, and its position is given by the 4th column.

4.6 6R robots: examples of tables

Kuka KR 160 R1570 (axis 2 shifted by 250 mm from axis 1; wrist with 3 concurrent axes):

jσjαjdjθjrj
1000q1r1
20−π/2d2q20
300d3q30
40−π/20q4r4
50π/20q50
60−π/20q60

r1: height of the shoulder; d2: offset axis 1 / axis 2; d3: length of the arm; r4: length of the forearm.

ABB IRB 140 / IRB 120 (no offset between axes 1 and 2: d2 = 0 and O0 = O1 = O2) – table of the Master course:

jαjdjθjrj
100θ10
2−π/20θ20
30d3θ30
4π/20θ4r4
5−π/20θ50
6π/20θ60
Classic pitfall

The signs of αj and of the lengths depend on the direction chosen for each zj (which must correspond to the positive rotation direction of the manufacturer: Fanuc and Kuka do not make the same choice) and on the “zero” position of the robot (all the qi = 0). Two different tables can be both correct: you must always check on the diagram that for q = 0 the obtained configuration is the one of the real robot.

Solved exercise 4 of course C2: DHm table of a UR robot (e.g. UR3)

The UR have 6R of which axes 2, 3, 4 are parallel (horizontal); there are lateral offsets between the arms. Dimensions of the UR3 (in mm): base 152, arm 244, forearm 213, offsets 112, 85 and 82.

Approach: (1) z1 vertical; z2, z3, z4 horizontal and parallel; z5 perpendicular to z4; z6 perpendicular to z5. (2) The x follow the common perpendiculars: along the arms for x2, x3. (3) The offsets along the z become rj.

A possible table (robot arm stretched horizontally for q = 0):

jσjαjdjθjrj
1000q1r1 = 152
20π/20q20
300d3 = 244q30
400d4 = 213q4r4 = 112
50π/20q5r5 = 85
60−π/20q6r6 = 82

The signs of d3, d4 and of the α may change according to the orientation chosen for the x and z (see the pitfall above). What does not change: 3 non-zero α, 2 lengths d (the two arms) and 4 offsets r.

Key terms

  • DHm convention
  • common perpendicular
  • joint variable
  • transition matrix
The essentials
  • Modified DH (Khalil–Kleinfinger): frame i is on the axis of joint i.
  • Each line: α (twist about x), d (along x), θ (about z), r (along z), in this order.
  • The variable is θ for a revolute joint and r for a prismatic joint (σ = 0 or 1).

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

In DHm, the parameter d is measured along which axis?

  1. x of frame i−1.
  2. z of frame i.

Solution

d is the distance between the axes z_{i−1} and z_i, measured along x_{i−1} (their common perpendicular).

Level 2 · Intermediate2

Two consecutive joint axes are parallel. What is the twist angle α between them?

Solution

Parallel axes: no twist, α = 0°. Perpendicular axes would give α = ±90°.

Level 3 · Professional3

A SCARA (R-R-P-R): in its DHm table, which joint has r as variable?

Solution

The third joint is the prismatic one (P): its variable is the distance r₃. The three others use θ.

Check yourself
  1. Which DHm parameters are always constant?

    αj and dj.

  2. For a slider joint, what is the joint variable?

    qj = rj (and θj is constant).

  3. In DHm, the z axis of frame j is placed…

    1. along the axis of joint j
    2. along the link, always

    z_j is the axis of rotation (or sliding) of joint j.

Compare with the SCARA DHM table →

5

The Direct Geometric Model (MGD)

8 min
You will learn

how to compute the pose of the tool from the joint variables.

5.1 Definition

The MGD gives the situation of the end effector (position + orientation) as a function of the joint variables:

X = f(q) ⟺ 0Tn(q) = 0T1(q1) 1T2(q2) … n−1Tn(qn)

  • The position of the end effector is read in the 4th column: 0On = 0Tn (0, 0, 0, 1)T.
  • The orientation is read in the 3×3 block (then, if needed, we extract Euler or Cardan angles, step 2).
  • For a tool offset nE in Rn: 0E = 0Tn nE, or 0TE = 0Tn nTE.

The MGD always has a unique solution: to a configuration q corresponds one single situation of the tool.

5.2 MGD of the SCARA

With the notations of course C1 (a1: length of arm 1, a2: arm 2, h: height), we have a1 = d2, a2 = d3, h = r1 − r4 in DHm:

XE = a1 cos q1 + a2 cos(q1+q2)
YE = a1 sin q1 + a2 sin(q1+q2)
ZE = h + q3
θE = q1 + q2 + q4

It is exactly the 4th column and the rotation angle of 0T4 found by DHm: the geometric method “by hand” and the DHm method give the same result. For a 6R robot, only the DHm method remains practicable.

Key terms

  • MGD
  • situation
  • tool offset
The essentials
  • The MGD gives the pose of the tool from the joint variables: T₀ₙ = T₀₁ T₁₂ … Tₙ₋₁ₙ.
  • For a planar chain, add the links like arrows, each one turned by the sum of the angles before it.
  • The MGD always has exactly one result.
3R planar arm: lengths 0.4, 0.3, 0.1 m, angles 20°, 30°, −50°.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

In this 3R arm, what is the orientation of the tool (θ₁ + θ₂ + θ₃) in degrees?

Solution

20 + 30 − 50 = 0°: the tool is horizontal.

Level 2 · Intermediate2

Compute x of the tool.

Solution

x = 0.4 cos 20° + 0.3 cos 50° + 0.1 cos 0° = 0.376 + 0.193 + 0.1 = 0.669 m.

Level 3 · Professional3

Compute y of the tool.

Solution

y = 0.4 sin 20° + 0.3 sin 50° + 0.1 sin 0° = 0.137 + 0.230 + 0 = 0.367 m.

Check yourself
  1. Where do you read the position of the end effector in 0Tn?

    In the 4th column.

  2. How many solutions does the MGD have?

    Always exactly one.

  3. The MGD is computed by…

    1. multiplying the matrices 0T1 · 1T2 · … · n−1Tn
    2. adding the angles only

    Each matrix is one line of the DHm table.

See the MGD computed live on the arm →

6

The Inverse Geometric Model (MGI)

15 min
You will learn

how to find the joint variables for a wanted pose, and how many solutions to expect.

6.1 Statement of the problem

The MGI gives the joint variables allowing to reach a wanted situation of the tool:

q = f−1(X) that is: solve 0Tn(q) = U0 = sxnxaxPxsynyayPysznzazPz0001

It is the model used permanently by the control cabinet: the programmer gives points in space (in X), the motors need set-points in q.

Remember: number of solutions of the MGI
  • No solution: the asked point is outside the workspace.
  • A finite number of solutions: each solution is an aspect (or posture) of the robot. SCARA: 2 (elbow right / elbow left). 6R robot of UR3 type: up to 8 solutions (shoulder left/right × elbow up/down × wrist flipped or not), sometimes only 4.
  • Infinitely many solutions: redundant robot (e.g. Kuka LWR with 7 DOF, whose elbow can turn without moving the tool) or singular configuration.

6.2 MGI of the SCARA, step by step

We know (XE, YE, ZE, θE) and look for (θ1, θ2, d3, θ4).

Step a – find θ2. We square and add the first two equations of the MGD:

XE² + YE² = a1² + a2² + 2a1a2 cos θ2 ⟹ cos θ2 = XE² + YE² − (a1² + a2²)2a1a2

θ2 = δ arccos( XE² + YE² − (a1² + a2²)2a1a2 ), δ = ±1

The choice δ = ±1 is the choice of the aspect (elbow right or left). If the quantity in the arccos leaves [−1, 1], the point is unreachable.

Step b – find θ1. The polar angle of E is atan2(YE, XE); we must subtract the angle between arm 1 and the line OE, which is atan2(a2 sin θ2, a1 + a2 cos θ2):

θ1 = atan2(YE, XE) − atan2(a2 sin θ2, a1 + a2 cos θ2)

Step c – the translation and the orientation:

d3 = ZE − h θ4 = θE − θ1 − θ2

Worked example

a1 = a2 = 0.3 m, we aim at XE = 0.3, YE = 0.3. Then cos θ2 = (0.18 − 0.18)/0.18 = 0 so θ2 = ±90°. With δ = +1: θ1 = 45° − atan2(0.3; 0.3) = 45° − 45° = 0°. Check: XE = 0.3 + 0.3 cos 90° = 0.3, YE = 0 + 0.3 sin 90° = 0.3 ✓. With δ = −1: θ1 = 45° + 45° = 90°, θ2 = −90°: the other aspect.

The worked example: a₁ = a₂ = 0.3 m, target (0.3, 0.3). The formula gives two arms that reach the same point, one for each sign δ: elbow on one side or the other of the line OE.

6.3 General method: Paul's method (Khalil–Dombre)

For a 6-DOF robot, we cannot “see” the geometry: we use a systematic method.

Paul's method
  1. Write the equation U0 = 0T1 1T2 ⋯ 5T6.
  2. Pre-multiply successively by the inverses: 1T0 U0 = 1T2 ⋯ 5T6, then 2T1 1T0 U0 = 2T3 ⋯ 5T6, etc.
  3. At each step, look in the matrix equality for an element depending on one single unknown (on the left, only one variable appears).
  4. Solve with standard equations:
  • X sin θ + Y cos θ = Z (type 2): solution with atan2, two possible solutions;
  • X sin θ = Y and X cos θ = Z: θ = atan2(Y/X, Z/X);
  • Xr = Y (slider): r = Y/X.

Spherical-wrist robots (axes 4, 5, 6 concurrent, the case of most industrial 6R): the problem decouples. The first 3 axes fix the position of the centre of the wrist (θ1, θ2, θ3: position problem), the last 3 fix the orientation (θ4, θ5, θ6: orientation problem, identical to the extraction of Euler angles of step 2).

Key terms

  • MGI
  • aspect / posture
  • Paul method
  • decoupling
The essentials
  • The MGI finds the joint variables that put the tool at a wanted pose.
  • It may have no solution, a finite number (often 2, up to 8 for a 6-axis robot) or an infinity (redundant robot).
  • For a 6-axis robot with a spherical wrist: first the position of the wrist (3 first joints), then the orientation (3 last).
The MGI of a 6-axis robot with a spherical wrist splits in two: the first three joints place the wrist centre, the last three set the orientation.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

Maximum number of IK solutions of a classic 6-axis robot with a spherical wrist?

Solution

2 (shoulder) × 2 (elbow) × 2 (wrist) = 8.

Level 2 · Intermediate2

2R arm L₁ = L₂ = 0.5 m. Point (0.5, 0.5). θ₂ (positive) in degrees?

Solution

cos θ₂ = (0.25 + 0.25 − 0.25 − 0.25) / (2 × 0.25) = 0 → θ₂ = 90°.

Level 3 · Professional3

Same arm, same point, θ₂ = +90°. θ₁ in degrees?

Hint

θ₁ = atan2(y, x) − atan2(L₂ sin θ₂, L₁ + L₂ cos θ₂).

Solution

θ₁ = atan2(0.5, 0.5) − atan2(0.5, 0.5) = 45° − 45° = 0°. Check: link 1 horizontal to (0.5, 0), link 2 vertical to (0.5, 0.5). ✓

Check yourself
  1. How many MGI solutions can a UR3-type 6R robot have, at most?

    8.

  2. In the SCARA MGI, what does the sign δ = ±1 choose?

    The aspect: elbow right or elbow left.

  3. The MGI can have…

    1. 0, 1, several or infinitely many solutions
    2. always exactly one solution

    Out of reach: 0; several postures: several; redundant robot: infinity.

Watch the inverse kinematics of the SCARA live →

7

Joint space, operational space and workspace

12 min
You will learn

two ways of representing the same configuration, and how to draw a workspace.

7.1 Two ways of representing the same configuration

  • Joint space: space of the variables (q1, …, qn), of dimension n (4 for a SCARA, 6 for a 6R). A configuration of the robot is a point Q.
  • Operational space: space of the situation of the tool (position x, y, z + orientation). The same configuration is a point E.
  • Q and E represent the same configuration. During a movement, Q describes a joint trajectory and E an operational trajectory (the one programmed by the roboticist): they correspond to the same task.
  • For a serial robot: to one Q corresponds one single E (MGD), but to one E may correspond several Qi, Qj … (MGI, aspects).

7.2 Exercise of course C1: 2-DOF SCARA

Solved exercise: images of trajectories (arms of the same length a)

Joint trajectory: Oa(0, 0) → Aa(0, π/2) → Ba(π/4, π/2) → Ca(π/4, 0) → Oa. (1) Image in the operational space of the segment OaBa of the joint space. (2) Origin in the joint space of the segment BoOo of the operational space.

Solution 1. On OaBa: q1 = (π/4)t, q2 = (π/2)t = 2q1, t ∈ [0, 1]. The MGD gives OE = a(cos q1 + cos 3q1, sin q1 + sin 3q1) = 2a cos q1 (cos 2q1, sin 2q1). In polar coordinates, with φ = 2q1: ρ = 2a cos(φ/2): a curve (part of a cardioid) which goes from Oo = (2a, 0) to Bo = (0, a√2) – a straight line in the joint space does not give a straight line in the operational space.

Solution 2. On the segment BoOo: x = 2as, y = a√2(1 − s). The MGI (equal arms, elbow q2 ≥ 0) gives q2 = arccos((x² + y² − 2a²)/(2a²)) and q1 = atan2(y, x) − q2/2. The result is a curve from Ba to Oa in the plane (q1, q2): a straight operational line imposes a non-rectilinear joint trajectory.

7.3 Joint limits and workspace

Each variable is bounded: qimin ≤ qi ≤ qimax. If the limits are fixed, the accessible joint space is a block (rectangular parallelepiped). Its image by the MGD is the workspace (space reachable by the tool centre). The more pivots the robot has, the more complex its borders are (crescent or mushroom shapes). We generally only represent the position, without orientation constraint.

Method: drawing the workspace of a SCARA (e.g. Omron Cobra)

Limits: θ1 ∈ [−105°, 105°], θ2 ∈ [−157.5°, 157.5°].

  1. Draw the image (by the MGD) of each of the 4 borders of the joint rectangle: arcs of circle centred on axis 1 (θ2 fixed) or on the end of arm 1 (θ1 fixed).
  2. Careful with the aspects: the borders of the operational space are not only the images of the joint borders. The line θ2 = 0 (stretched arm) separates the two aspects and its image (circle of radius a1 + a2) is also a border.
  3. Superimpose all the borders to obtain the workspace.

Example of a SCARA (a1 = 325 mm, a2 = 275 mm): each colour corresponds to an aspect; in the overlapping zone, the same point is reachable with two postures.

7.4 The different forms of movement

ModeBehaviourRelation between the spaces
Linear (operational space)Straight line at constant speed along each side; stop (zero speed) at each vertex.The operational space imposes the joint space (MGI at each instant).
Joint (point to point)Does not follow the sides; optimal trajectory for the motors.The joint space induces the operational space (unpredictable trajectory of the tool).
Linear at constant speedStraight lines but a deviation is tolerated at the vertices: no stop (e.g. glue deposit without burr).Imposed along the sides, induced at the vertices.

Key terms

  • joint space
  • operational space
  • workspace
  • joint stops

Which shape is the workspace?

There is no single formula, and the workspace is not always a disc: its shape depends on the geometry of the robot (lengths, kinds of joints) and on its joint limits. For the planar 2-link arm, there is a simple relation:

| L1 − L2 | ≤ √( x² + y² ) ≤ L1 + L2

  • Without joint limits it is a ring (a disc with a hole in the middle).
  • It is a full disc only if L₁ = L₂: the inner radius is then 0.
  • With joint limits it is only a part of the ring, bounded by arcs of circles.
Top view of four workspaces. The orange dot is the base. The dashed circle shows the ring the same arm would have without joint limits.
RobotShape of the workspace
1 revolute jointa circle (only its edge, not the disc)
Planar 2-link arma ring between |L₁ − L₂| and L₁ + L₂ (a full disc if L₁ = L₂)
Gantry (P-P-P)a box: each axis has its stroke
SCARAa ring extruded in height (a thick tube), often cut by the joint limits
6-axis robotan almost spherical volume, with a hole near the base and zones removed by the joint limits
Delta robota dome or rounded cylinder under the base
Mobile robotthe whole floor in theory; the room and its obstacles in practice

Reachable or dexterous? The reachable workspace holds the points the tool can touch with at least one orientation; the dexterous workspace holds the points it can reach with every orientation. The dexterous workspace is much smaller (for the planar 2-link arm it is almost empty).

For a real industrial robot there is no simple formula: the workspace is computed by sweeping the joint angles between their limits (as in the third drawing), and the manufacturer draws it in the data sheet, usually as a side view and a top view with the reach.

The essentials
  • Joint space: the vector q of the joint variables. Operational space: the pose X of the tool.
  • The workspace is the set of positions the tool can reach, with the joint limits.
  • The number of degrees of freedom of the task tells how many joints are needed.
Upper half of the workspace of the 2R arm (0.5 m + 0.4 m) when θ₁ is limited to 0°…180°.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

A planar task needs x, y and the angle of the tool. How many DOF?

Solution

3: a 3R planar arm is exactly enough.

Level 2 · Intermediate2

A planar arm has 4 joints for this 3-DOF task. What is its degree of redundancy?

Solution

4 − 3 = 1: there is an infinity of ways to place the tool, the robot can choose one to avoid an obstacle.

Level 3 · Professional3

2R arm 0.5 m + 0.4 m with θ₁ in 0°…180° and θ₂ free. Area of the workspace (m²)?

Solution

Half of the ring: π (0.9² − 0.1²) / 2 = π × 0.8 / 2 ≈ 1.26 m² (a little more in reality, since the second link can still point below the axis).

Check yourself
  1. A straight line in the joint space: is it a straight line for the tool?

    No. In general the tool follows a curve.

  2. Which line separates the two aspects of a SCARA?

    θ2 = 0 (stretched arm); its image is the circle of radius a1 + a2.

  3. The workspace is limited by…

    1. the link lengths and the joint limits
    2. the colour of the robot

    It is the image of the joint domain by the MGD.

8

The kinematic model: the Jacobian matrix

12 min
You will learn

how joint speeds give tool speeds, why singularities exist and how to invert the model.

(Complement from Khalil–Dombre, essential to understand singularities and the link speeds/forces.)

8.1 The direct kinematic model

It links the operational speeds to the joint speeds:

X˙ = J(q) q˙, Jij = ∂fi(q)∂qj (matrix m × n)

For a small robot, J is obtained by differentiating the MGD. For a robot with more than 3 DOF, we use the kinematic Jacobian: the column k is

jk = σk ak + σ̄k (ak ∧ Lk,n)σ̄k ak

where ak is the unit vector of zk and Lk,n = OkOn: a pivot creates a speed ak ∧ Lk,n and a rotation ak; a slider creates a translation ak.

Worked example

Jacobian of the planar SCARA (2 DOF). By differentiating XE, YE:

J = −a1s1 − a2s12−a2s12a1c1 + a2c12a2c12, det J = a1a2 sin θ2

det J = 0 for θ2 = 0 (stretched arm) or θ2 = π (folded arm): these are the singularities, exactly the border between the two aspects seen in step 7.

Each column of the Jacobian is the speed of the tool when only one motor turns (1 rad/s): around the base for column 1, around the elbow for column 2 (arm with L₁ = 0.5 m, L₂ = 0.4 m, θ₁ = 30°, θ₂ = 45°).

8.2 Singularities

When the rank of J drops, the robot locally loses the possibility of moving in some directions. For a square J: singularity if det J = 0; redundant robot: det(JJT) = 0. Example Stäubli RX-90: det(3J6) = −C3D3RL4S5(S23RL4 − C2D3), hence 3 singularities: C3 = 0 (stretched arm), S23RL4 − C2D3 = 0 (wrist on axis 1, shoulder), S5 = 0 (axes 4 and 6 aligned, wrist).

8.3 The inverse kinematic model

  • Regular case (J square and invertible): q˙ = J−1(q) X˙.
  • Redundant robot: pseudo-inverse q˙ = J+ X˙ with J+ = JT(JJT)−1 (solution of minimal norm).
  • Near a singularity, J−1 explodes (enormous joint speeds): we use damped least squares q˙ = JT(JJT + λ²I)−1 X˙.

Link with statics: the motor torques needed to exert a force F on the environment are Γ = JT(q) F.

Key terms

  • Jacobian matrix
  • singularity
  • pseudo-inverse
  • damped least squares
The essentials
  • The Jacobian J links the joint speeds to the tool speed: Ẋ = J(q) q̇.
  • Each column of J is the tool speed when only one joint moves at 1 rad/s.
  • When det J = 0 the robot is singular: it cannot move the tool in some direction.
For the 2R arm, det J = L₁ L₂ sin θ₂: zero when the arm is stretched (0°) or folded (±180°).

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

2R arm, L₁ = 0.5, L₂ = 0.4, θ₂ = 90°. det J = L₁ L₂ sin θ₂ = ?

Solution

0.5 × 0.4 × sin 90° = 0.5 × 0.4 × 1 = 0.2 (m²). This is the largest possible value: the arm is far from any singularity.

Level 2 · Intermediate2

Same arm, θ₁ = 0, θ₂ = 90°. Joint 1 turns at 1 rad/s, joint 2 is still. Tool speed along x (ẋ = −L₁ sin θ₁ θ̇₁ − L₂ sin(θ₁+θ₂)(θ̇₁+θ̇₂))?

Solution

ẋ = −0.5 × sin 0 × 1 − 0.4 × sin 90° × 1 = 0 − 0.4 = −0.4 m/s: the tool goes left, perpendicular to the line from the base to the tool.

Level 3 · Professional3

For which θ₂ (degrees, between 0 and 180) is this 2R arm singular?

  1. 0° and 180°.
  2. 90°.
  3. 45°.

Solution

sin θ₂ = 0 for 0° (arm stretched) and 180° (arm folded). In both cases the tool cannot move along the arm.

Check yourself
  1. What is the determinant of the Jacobian of the planar 2-axis arm when the arm is stretched?

    det J = a1a2 sin θ2 = 0: it is a singularity.

  2. Which formula links the motor torques to a force exerted by the tool?

    Γ = JT(q) F.

  3. At a singularity, the Jacobian…

    1. loses rank (det J = 0 for a square J)
    2. becomes larger

    The tool can no longer move in some direction.

9

Motion generation: the speed laws

25 min
You will learn

how to choose and compute the time law of a movement: bang-bang, trapezoid, jerk-limited, sin², polynomial, multi-axis.

9.1 The principle

Knowing the start and the arrival is not enough: we must decide how the position evolves in time. For a joint movement from qi to qf:

q(t) = qi + r(t) D, D = qf − qi, r(0) = 0, r(tf) = 1

The function r(t) defines the motion law. It is chosen according to the limits of the motor: maximum speed Vmax (given by the gearmotor) and maximum acceleration a (given by the torque, therefore by the motor current).

9.2 Bang-bang law

Zero speed at the start and at the end. First half at constant acceleration, second half at constant deceleration. The maximum speed is reached at mid-course, the mean speed is Vmax/2. The position is made of two parabolas tangent to the horizontal at the start and at the end.

q˙max = 2|D|tf, q¨max = 4|D|tf², tf = max( 2|D|kv , 2 |D| / ka )

Continuous in position and in speed, discontinuous in acceleration.

9.3 Speed trapezoid law (the most used)

Three phases: (1) constant acceleration a up to Vmax; (2) constant speed Vmax; (3) constant deceleration down to the stop. Adapted to large displacements (Vmean ≃ Vmax). It saturates both speed and acceleration: it is the minimum-time law.

Method: computation of T1, T2, T3

Data: displacement X, speed Vmax, acceleration a.

  1. Phase 1: T1 = Vmax/a; displacement X1 = ½aT1² = Vmax²/(2a).
  2. Test: the plateau exists if X > 2X1, that is X > Vmax²/a.
  3. If yes (trapezoid): T1 = T3 = Vmax/a, T2 = X/Vmax − Vmax/a, Ttot = X/Vmax + Vmax/a.
  4. If not (degraded trapezoid = triangle = bang-bang): Vmax is never reached. T1 = T3 = √(X/a), T2 = 0, V* = √(Xa), Ttot = 2√(X/a).

Check: the displacement is the area under the speed curve, X = aT1² + aT1T2 (if T1 = T3).

Solved exercise of course C3: SEPRO Cartesian robot, trapezoid law
CaseX (m)Vmax (m/s)a (m/s²)Vmax²/aT1 (s)T2 (s)T3 (s)Ttot (s)
a)10.510.25 < X0.51.50.52.5
b)1111 = X1012
c)11.512.25 > X1012
d)1120.5 < X0.50.50.51.5
e)0.10.50.50.5 > X0.44700.4470.894

Details. a) Trapezoid: T1 = 0.5/1 = 0.5 s; T2 = 1/0.5 − 0.5 = 1.5 s. Check: X = 1·0.25 + 1·0.5·1.5 = 1 m ✓. b) Limit case: Vmax is reached exactly at mid-course, T2 = 0 (triangle). c) Bang-bang: T1 = √(1/1) = 1 s; V* = √(1·1) = 1 m/s: we never reach 1.5 m/s, increasing Vmax is useless here. d) Trapezoid: T1 = 0.5 s; T2 = 1/1 − 0.5 = 0.5 s. Check: 2·0.25 + 1·0.5 = 1 m ✓. e) Bang-bang: T1 = √(0.1/0.5) = 0.447 s; V* = √0.05 = 0.224 m/s.

9.4 Acceleration trapezoid law (limited jerk)

Seven phases: increasing, constant, decreasing acceleration; constant speed; then the three symmetrical phases. The acceleration is continuous: we limit the sudden variations of current in the motor, which increases its life (used on cobots, e.g. Fanuc CR-15iA).

9.5 Sine-squared speed law

Phase 1: V(t) = Vmax sin²(ωt) up to sin²(ωt) = 1; phase 2 at constant speed; phase 3 symmetrical. The acceleration (Vmax ω sin 2ωt) is continuous (“sine–ramp–sine” profile).

Comparison trapezoid / sin² (same acceleration duration T):

  • at identical maximum acceleration Amax: trapezoid V = TAmax; sin² V = (2/π)TAmax ≈ 0.64 TAmax, that is 36 % less;
  • but the smoothness of the sin² (no current discontinuity) allows to tolerate accelerations up to 100 % larger; the speed reached is then at least equal to the one of the trapezoid, and the motor is better protected.
Top: the speed. Bottom: the acceleration. With the trapezoid the acceleration jumps at the start and the end of each phase; with the sine-squared law it rises and falls smoothly, which spares the motor and the mechanics.

9.6 Degree-5 polynomial interpolation (Khalil–Dombre)

For a movement continuous in position, speed and acceleration (class C²), with zero speeds and accelerations at the ends:

r(t) = 10(t/tf)³ − 15(t/tf)⁴ + 6(t/tf)⁵, q˙max = 15|D|8tf, q¨max = 10|D|√3 tf²

9.7 Multi-axis movement: homothetic trapezoids

For a point-to-point joint displacement, we want all the axes to start and stop at the same time.

Method
  1. Compute the displacement Δqi of each axis.
  2. The axis with the largest displacement receives the maximum speed Vmax.
  3. Each other axis receives Vi = Vmax Δqi/Δqmax (same trapezoid shape, same durations T1, T2, T3).

Example of the course: Δq = (+50°, +20°, −30°), Vmax = 100 ⇒ V = (100, 40, −60). The axes are synchronised, but the trajectory of the tool is not a straight line.

Solved exercise of course C3: UR3 between A and B

A = (400, 0, −30), B = (400, 200, −30). Values read on the pendant:

θ1θ2θ3
Point A−20.68°−64.42°89.98°
Point B14.76°−50.74°67.34°
Δθ+35.44°+13.68°−22.64°

Maximum allowed speed: 50°/s. Each third of the time: acceleration, constant speed, deceleration (T1 = T2 = T3 = T).

  • Axis 1 (largest displacement): V1 = 50°/s. Area of the trapezoid: Δθ1 = ½V1T + V1T + ½V1T = 2V1T ⇒ T = 35.44/(2 × 50) = 0.354 s; total duration 3T = 1.06 s; acceleration V1/T ≈ 141°/s².
  • Axis 2: V2 = 50 × 13.68/35.44 = +19.3°/s. Axis 3: V3 = 50 × (−22.64)/35.44 = −31.9°/s.

Remark: the asked displacement is a straight line (only y varies), but in joint mode with homothetic trapezoids the tool does not follow it exactly; for a real straight line we need a linear movement (MGI at each instant).

9.8 Joint or operational?

Generation in the joint spaceGeneration in the operational space
+ few computations (no online MGI)+ geometry of the trajectory under control (line, circle)
+ no problem with singularities– MGI at every point of the trajectory
+ motor limits directly exploited– possible failure near a singularity or if the aspect changes
– unpredictable trajectory of the tool– “average” speed limits, under-use of the robot
⇒ fast movements in free space⇒ welding, gluing, cutting

Key terms

  • bang-bang
  • speed trapezoid
  • jerk
  • homothetic trapezoids
  • minimum time
The essentials
  • A trajectory says where each joint is at every instant: q(t).
  • Trapezoid: simple, but the acceleration jumps. Polynomial of degree 5: speed and acceleration start and end at zero.
  • Degree 5: s(u) = 10u³ − 15u⁴ + 6u⁵ with u = t / T, then q = q₀ + (q₁ − q₀) s(u).
Degree-5 law: smooth position; the speed is a bell with a maximum of 1.875 at mid-time.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

s(u) at mid-time (u = 0.5)?

Solution

10 × 0.125 − 15 × 0.0625 + 6 × 0.03125 = 1.25 − 0.9375 + 0.1875 = 0.5: half the way at half the time.

Level 2 · Intermediate2

Joint from 0° to 60° in T = 2 s with the degree-5 law. Maximum speed (°/s)? (max of ds/du = 1.875)

Solution

q̇ max = (q₁ − q₀) × 1.875 / T = 60 × 1.875 / 2 = 56.25 °/s.

Level 3 · Professional3

The motor allows 45 °/s at most. Shortest duration T for the same 60° move?

Solution

60 × 1.875 / T ≤ 45 → T ≥ 112.5 / 45 = 2.5 s.

Check yourself
  1. When does the trapezoid degrade into a triangle?

    When X ≤ Vmax²/a: the robot does not have the time to reach Vmax.

  2. X = 0.1 m, Vmax = 0.5 m/s, a = 0.5 m/s²: what is the total time?

    Vmax²/a = 0.5 > 0.1: triangle; Ttot = 2√(0.1/0.5) ≈ 0.894 s.

  3. Why not a bang-bang law with infinite jerk?

    1. The sudden jumps of acceleration shake the robot
    2. It is too slow

    Smoother laws (trapezoid of acceleration, degree 5) limit vibrations.

10

Going further: dynamics and control

8 min
You will learn

what the dynamic model contains and the two classic ways of controlling a robot.

(Synthesis of chapters 1.4 and 3 of Khalil–Dombre.)

10.1 The dynamic model

It links the motor torques to the movements:

Γ = A(q) q¨ + C(q, q˙) q˙ + Q(q) + Fvq˙ + Fs sign(q˙) + JTFe

  • A(q): inertia matrix (n × n, symmetric positive definite);
  • C(q, q˙)q˙: centrifugal and Coriolis effects;
  • Q(q): gravity;
  • Fv, Fs: viscous and dry friction; JTFe: force exerted on the environment.

Two computation methods: Lagrange (from the kinetic energy E and the potential energy U: Γi = d/dt(∂L/∂q˙i) − ∂L/∂qi, L = E − U) and Newton–Euler (recursive, numerically more efficient).

10.2 Control

  • Joint PID (classic control, axis by axis): Γ = Kp(qd − q) + Kd(q˙d − q˙) + Ki∫(qd − q) dt. Simple, used in industry, but the performance varies with the configuration.
  • Non-linear decoupling control (computed torque): Γ = Â(q) w + Ĥ(q, q˙) with w = q¨d + Kd(q˙d − q˙) + Kp(qd − q). We compensate the dynamics of the robot, which then behaves like n decoupled double integrators.

Key terms

  • inertia matrix
  • Coriolis
  • PID
  • computed torque
The essentials
  • Dynamics links torques and motions: τ = M(q) q̈ + C(q, q̇) q̇ + G(q).
  • G(q) is the torque needed just to hold the arm against gravity.
  • Control uses these models: gravity compensation, then a PID on the error.
The control loop: the controller compares the wanted q with the measured q and computes the torque.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

A 2 kg mass at 0.5 m from the joint, arm horizontal. Gravity torque (g = 9.81)?

Solution

τ = m g l = 2 × 9.81 × 0.5 = 9.81 N·m.

Level 2 · Intermediate2

Same mass, but the arm is at 60° above the horizontal. Gravity torque?

Solution

τ = m g l cos θ = 9.81 × cos 60° = 4.905 N·m: the higher the arm, the smaller the lever arm.

Level 3 · Professional3

The link (inertia about the joint I = 0.5 kg·m²) must accelerate at 4 rad/s² while horizontal (gravity 9.81 N·m). Total torque?

Solution

τ = I θ̈ + gravity = 0.5 × 4 + 9.81 = 2 + 9.81 = 11.81 N·m.

Check yourself
  1. What are the three kinds of terms in the dynamic model besides friction?

    Inertia (Aq¨), centrifugal/Coriolis (Cq˙) and gravity (Q).

  2. Holding the arm still (q̇ = q̈ = 0) needs which term?

    1. Gravity Q(q)
    2. Inertia A q̈
    3. Coriolis C q̇

    With no motion, only gravity (and friction) remain.

  3. A PID that adds a computed gravity term is called…

    1. PID with gravity compensation
    2. open loop

    The model gives the gravity torque, the PID only corrects the rest.

11

Revision sheet: the essentials on one page

5 min
You will learn

all the key formulas of the course in one place.

TopicKey formula
Rotationcolumns of 0R1 = axes of R1 in R0; R−1 = RT; det R = 1
Euler ZXZ (moving axes, on the right)Rot(z, φ) Rot(x, θ) Rot(z, ψ)
Cardan / RPY (fixed axes, on the left)Rot(z, α) Rot(y, β) Rot(x, γ); β = atan2(−r31, ±√(r11² + r21²)); singular if cos β = 0
Homogeneouspoint (…, 1), vector (…, 0); 0Tn = ∏ j−1Tj; inverse ( RT −RTP ; 0 | 1 )
DHmzj on the axis of Lj; xj on the common perpendicular of zj, zj+1. αj: zj−1 → zj around xj−1; dj: along xj−1; θj: xj−1 → xj around zj; rj: along zj. Pivot: q = θ; slider: q = r. j−1Tj = Rot(x, α) Trans(x, d) Rot(z, θ) Trans(z, r)
MGD SCARAX = a1c1 + a2c12, Y = a1s1 + a2s12, Z = h + q3, θE = q1 + q2 + q4
MGI SCARAθ2 = ± arccos((X² + Y² − a1² − a2²)/(2a1a2)) ; θ1 = atan2(Y, X) − atan2(a2s2, a1 + a2c2) ; d3 = Z − h ; θ4 = θE − θ1 − θ2
Number of MGI solutions0 (out of the workspace), finite (aspects: 2 for a SCARA, ≤ 8 for a 6R), infinite (redundant, singularity)
JacobianX˙ = Jq˙; singularity if det J = 0; statics Γ = JTF
Trapezoidif X > V²/a: T1 = T3 = V/a, T2 = X/V − V/a. Otherwise bang-bang: T1 = T3 = √(X/a), V* = √(Xa)
HomotheticVi = Vmax Δqi/Δqmax
sin²at equal Amax: V = 0.64 TAmax; continuous acceleration
Degree-5 polynomialr = 10τ³ − 15τ⁴ + 6τ⁵, class C²
The essentials
  • Position: rotation matrices, homogeneous transforms, DHm → MGD; inverse → MGI.
  • Speed: Jacobian; singularities when det J = 0.
  • Time: motion laws; force: dynamics and control.
The whole course on one line: where the tool is, how fast it moves, when it gets there, and with which forces.

Worked exercises

Do each exercise on paper first, then type your answer (a small error is accepted) or pick an option. Open the hint if you are stuck, then read the solution: every step is explained.

Level 1 · Beginner1

Which tool gives the tool speed from the joint speeds?

  1. The Jacobian.
  2. The MGI.
  3. The DHm table alone.

Solution

The Jacobian: Ẋ = J q̇.

Level 2 · Intermediate2

A 6-axis robot: how many lines in its DHm table?

Solution

6 (one per joint), plus possibly a fixed line for the tool.

Level 3 · Professional3

Order the steps to make a robot follow a straight line: (1) MGI at each point, (2) cut the line into points, (3) send the joint values to the motors.

  1. 2 → 1 → 3
  2. 1 → 2 → 3
  3. 3 → 1 → 2

Solution

First cut the line into many close points, then compute the MGI of each point, then send these joint values to the motors at the right rhythm.

Check yourself
  1. MGD: X = f(q). MGI: …

    1. q = f⁻¹(X)
    2. Ẋ = J q̇

    The MGI goes back from the tool to the joints.

  2. Ẋ = J(q) q̇ is the…

    1. direct kinematic model
    2. dynamic model

    It links speeds, not torques.

  3. Γ = A q̈ + C q̇ + Q is the…

    1. dynamic model
    2. geometric model

    It gives the motor torques Γ needed for a motion.

Glossary

All the words of the lessons in one place.

TermMeaning
MGDDirect geometric model: joint variables → situation of the tool.
MGIInverse geometric model: situation of the tool → joint variables.
DHmModified Denavit–Hartenberg convention (Khalil–Kleinfinger).
AspectOne of the finite postures that reach the same situation.
SingularityA configuration where the Jacobian loses rank.
JacobianThe matrix linking joint speeds to tool speeds.
Homogeneous matrixA 4×4 matrix containing a rotation and a translation.
Redundant robotA robot with more DOF than the task needs.
Gimbal lockLoss of a degree of freedom of the angle representation.
WorkspaceThe image of the joint limits by the MGD.

Sources and references

This course was written from these books, papers, standards and documentation. They are also the best way to go further.

Course materials

  • M. Abbas, Robot Modeling (UE33c): DHm, direct and inverse geometric models, kinematic models, Master MARS, Université d’Orléans.

References

  1. O. Khatib, Introduction to Robotics, course notes, Stanford University, chapter 4: The Jacobian. used for: the Jacobian: differential motion, velocities and static forces
  2. W. Khalil, E. Dombre, Modeling, Identification and Control of Robots, Hermes Penton Science, 2002 (French edition: Modélisation, identification et commande des robots, Hermès, 1999). used for: the whole course: DHM, MGD, MGI, Jacobian, motion laws, dynamics
  3. W. Khalil, J.-F. Kleinfinger, “A new geometric notation for open and closed-loop robots”, IEEE International Conference on Robotics and Automation, 1986. used for: the modified DH notation
  4. J. J. Craig, Introduction to Robotics: Mechanics and Control, 4th ed., Pearson, 2017. used for: frames, transforms and Euler angles
  5. B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo, Robotics: Modelling, Planning and Control, Springer, 2009. used for: kinematics, Jacobian and trajectories
  6. M. W. Spong, S. Hutchinson, M. Vidyasagar, Robot Modeling and Control, 2nd ed., Wiley, 2020. used for: dynamics (Lagrange)

You completed the full course!

Now apply it: open the SCARA or the 6-axis robot page and compare their DH tables, inverse kinematics and motion with what you learned.

Go to the singularities course → Go to the SCARA robot → Back to the roadmap