slama.dev

Robotics 1

notes notes Icon, released 30. 11. 2022, updated 16. 12. 2022; available in [PDF]

Preface

This website contains my lecture notes from a lecture by Lorenzo Masia from the academic year 2022/2023 (University of Heidelberg). If you find something incorrect/unclear, or would like to contribute, feel free to submit a pull request (or let me know via email).

Note that since the course hasn’t ended yet, the notes are not complete and won’t be until the end of the semester.

Robotics Components

Definition (link/member): individual bodies making up a mechanism

Definition (joint): connection between multiple links

Definition (kinematic pair): two links in contact such that it limits their relative

Definition (kinematic chain): assembly of links connected by joints

Open and closed kinematic chains

Degrees of Freedom

Definition (deegree of freedom) of a mechanical system is the number of independent parameters that define its configuration. It can be calculated by the Grübler Formula:

DOF=λ(n1)i=1jci\text{DOF} = \lambda (n - 1) - \sum_{i = 1}^{j} c_i

where

For example, the following has 3(41)24=13 (4 - 1) - 2 \cdot 4 = 1 DOF: DOF

Definition (coincident joints): when there are more than two kinematic pairs in the same joint

Coincident joints.

Actuators

Definition (actuator): a mechanical device for moving or controlling something

DC motor illustration.

PWM

Incremental and absolute optical encoders.

Kinematics

Kinematic spaces.

Forward (direct) Kinematics

Definition (forward/direct kinematics): the process of finding the position/orientation of the end-effector (r1,,rm)(r_1, \ldots, r_m) given a set of joint parameters (q1,,qn)(q_1, \ldots, q_n).

(r1,,rm)=F(q1,,qn)(r_1, \ldots, r_m) = F(q_1, \ldots, q_n)

Body Pose

The pose/frame of a rigid body can be described by its position and orientation (wrt. a reference frame).

R=[xyz]=[xxyxzxxyyyzyxzyzzz]R = \begin{bmatrix} x' & y' & z' \end{bmatrix} = \begin{bmatrix} x_x' & y_x' & z_x' \\ x_y' & y_y' & z_y' \\ x_z' & y_z' & z_z' \end{bmatrix}

The elementary rotations about each of the axes are the following:

Z rotation.

Rx(α)=[1000cosαsinα0sinαcosα]Ry(α)=[cosα0sinα010sinα0cosα]Rz(α)=[cosαsinα0sinαcosα0001] \begin{aligned} R_x(\alpha) &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \alpha & -\sin \alpha \\ 0 & \sin \alpha & \cos \alpha \end{bmatrix} \\ R_y(\alpha) &= \begin{bmatrix} \cos \alpha & 0 & \sin \alpha \\ 0 & 1 & 0 \\ -\sin \alpha & 0 & \cos \alpha \end{bmatrix} \\ R_z(\alpha) &= \begin{bmatrix} \cos \alpha & -\sin \alpha & 0 \\ \sin \alpha & \cos \alpha & 0 \\ 0 & 0 & 1 \end{bmatrix} \\ \end{aligned}

When discussing multiple frames, we use the following notation:

tofromR=toRfrom=Rtofrom{\scriptstyle \text{to} \atop \scriptstyle\text{from}} R = {\scriptstyle \text{to} \atop \scriptstyle\text{}} R {\scriptstyle \text{} \atop \scriptstyle\text{from}} = R {\scriptstyle \text{to} \atop \scriptstyle\text{from}}

E.g. if we have the same point p0,p1,p2p_0, p_1, p_2 in three different frames, we know that

p1=R21p2p0=R10p1p0=R20p2 \begin{aligned} p_1 &= R^1_2 \cdot p_2 \\ p_0 &= R^0_1 \cdot p_1 \\ p_0 &= R^0_2 \cdot p_2 \end{aligned}

For a minimal representation, we will use Euler’s ZYZ angles, which does three rotations:

R=Rz(φ)Ry(ϑ)Rz(ψ)=[cφcϑcψsφsψcφcϑsψsφcψcφsϑsφcϑcψ+cφsψsφcϑsψ+cφcψsφsϑsϑcψsϑsψcϑ] \begin{aligned} R &= R_z (\varphi) R_{y'} (\vartheta) R_{z''} (\psi) \\ &= \begin{bmatrix} c_{\varphi} c_{\vartheta} c_{\psi} - s_{\varphi} s_{\psi} & -c_{\varphi} c_{\vartheta} s_{\psi} - s_{\varphi} c_{\psi} & c_{\varphi} s_{\vartheta} \\ s_{\varphi} c_{\vartheta} c_{\psi} + c_{\varphi} s_{\psi} & -s_{\varphi} c_{\vartheta} s_{\psi} + c_{\varphi} c_{\psi} & s_{\varphi} s_{\vartheta} \\ -s_{\vartheta} c_{\psi} & s_{\vartheta} s_{\psi} & c_{\vartheta} \end{bmatrix} \end{aligned}

For the inverse problem (calculating angles from a matrix of numbers), we can do φ=atan2(r2,3,r1,3)ϑ=atan2(r1,32+r2,32,r3,3)ϑ(0,π) since we took + signψ=atan2(r3,2,r3,1) \begin{aligned} \varphi &= \mathrm{atan}2 (r_{2,3}, r_{1, 3}) \\ \vartheta &= \mathrm{atan}2 \left(\sqrt{r_{1,3}^2 + r_{2,3}^2}, r_{3, 3}\right) \quad \vartheta \in (0, \pi)\ \text{since we took + sign} \\ \psi &= \mathrm{atan}2 \left(r_{3,2}, -r_{3,1}\right) \end{aligned}

Denavit & Hartenberg Notation

For relating the base and the end effector, we need to both rotate and translate, so we’ll use homogeneus coordinates (matrix is 4×44 \times 4, encoding both rotation and translation):

AEEA=[AEERAEEP0001] {\scriptstyle \text{A} \atop \scriptstyle\text{EE}} A = \begin{bmatrix} {\scriptstyle \text{A} \atop \scriptstyle\text{EE}} R & {\scriptstyle \text{A} \atop \scriptstyle\text{EE}} P \\ 000 & 1\end{bmatrix}

To create the homogeneous coordinates in a standardized way, we use the Denavit & Hartenberg (DH) notation which systematically relates the frames of two consecutive links. We have 4 parameters, each of which relates frame ii to frame i1i - 1:

parameter meaning
link length aia_i distance between ziz_i and zi1z_{i - 1} along xix_i
link offset did_i distance between xix_i and xi1x_{i - 1} along ziz_i
link twist αi\alpha_i angle between ziz_i and zi1z_{i - 1} around xix_i
joint angle θi\theta_i angle between xix_i and xi1x_{i - 1} around ziz_i

Denavit & Hartenberg Notation

Anthropomorphic arm.

Example: anthropomorphic arm (3 revolute joins):

  aia_i did_i αi\alpha_i θi\theta_i
1 00 π/2\pi / 2 00 θ1\theta_1^*
2 a2a_2 00 00 θ2\theta_2^*
3 a3a_3 00 00 θ3\theta_3^*

We then get the following transformations:

A10(θ1)=[c10s10s10c1001000001]R=Rz(θ1)Rx(π/2)Aii1(θ1)=[cisi0aicisici0aisi00100001]i=2,3 \begin{aligned} A^0_1 (\theta_1) &= \begin{bmatrix} c_1 & 0 & s_1 & 0 \\ s_1 & 0 & -c_1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \quad R = R_z(\theta_1) \cdot R_x(\pi / 2) \\ A^{i-1}_i (\theta_1) &= \begin{bmatrix} c_i & -s_i & 0 & a_i c_i \\ s_i & c_i & 0 & a_i s_i \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \quad i = 2, 3\\ \end{aligned}

To get the final transformations, we can multiply the matrices and get T30(q)=A10A21A32T^0_3 (\mathbf{q}) = A^0_1 A^1_2 A^2_3

Inverse Kinematics

Definition (inverse kinematics): the process of finding a set of joint parameters (q1,,qn)(q_1, \ldots, q_n) given the position/orientation of the end-effector (r1,,rm)(r_1, \ldots, r_m).

(q1,,qn)=G(r1,,rm)(q_1, \ldots, q_n) = G(r_1, \ldots, r_m)

Definition (primary workspace): set WS1\mathrm{WS}_1 of all positions pp that can be reached with at least one orientation RR

Definition (secondary workspace): set WS2\mathrm{WS}_2 of all positions pp that can be reached with any orientation RR

Analytical solution (closed form)

Spherical wrist.

Example: spherical wrist (3 revolute joins):

T63(q)=[c4c5c6s4s6c4c5s6s4c6c4s5c4s5d6s4c5c6+c4s6s4c5s6+c4c6s4s5s4s5d6s5c6s5s6c5c5d60001]T_6^3(\mathbf{q}) = \begin{bmatrix} c_4 c_5 c_6 - s_4 s_6 & -c_4 c_5 s_6 - s_4 c_6 & c_4 s_5 & c_4 s_5 d_6 \\ s_4 c_5 c_6 + c_4 s_6 & -s_4 c_5 s_6 + c_4 c_6 & s_4 s_5 & s_4 s_5 d_6 \\ -s_5 c_6 & s_5 s_6 & c_5 & c_5 d_6 \\ 0 & 0 & 0 & 1 \end{bmatrix}

The matrix RR is a ZYZ Euler rotation matrix and can be solved as such (see Body pose).

Definition (decoupling): dividing inverse kinematics problem for two simpler problems, inverse position kinematics and inverse orientation kinematics

The general approach is the following:

  1. calculate the orientations and position where the wrist needs to be
  2. calculate the orientations of the rest of the robot
Numerical solution (iterative form)

TBA

# will be typeset shortly
H(q) = 1/2 ||r_d f_r(q)||^2
dH / dq = 1/2  2 (-1) [r_d - f_r(q)]^T J_r(q)
dH / dq = (-1) [r_d - f_r(q)]^T J_r(q)  // nabla transposes
nabla q H(q) = (-1) [r_d - f_r(q)] J_r(q)^T  // nabla transposes