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.

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‖. ✓

Key terms

  • reference frame
  • rotation matrix
  • direction cosines
  • orthogonal matrix
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).

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π[.

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.

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
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

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 …).

Key terms

  • homogeneous matrix
  • homogeneous coordinates
  • composition
  • inverse transformation
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).

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.

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

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
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).

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
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.

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.

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
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.

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
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.

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.

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
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.

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.

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
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.

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
Check yourself
  1. What are the three kinds of terms in the dynamic model besides friction?

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

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²

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.

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 SCARA robot → Back to the roadmap