Robotic Mechanics and Modeling/Dynamics

Dynamics
The study of dynamics requires that we extend kinematic equations for a system to account for balances of loads or energy to model motion dependent on inertia, loading, energy-storage elements, and energy-dissipating elements.

Simple Swinging Rod (Pendulum) Under Gravity
For the figure shown, we can write the kinematic equations as:

$$ x_P=L \cos \theta $$

$$ y_P=L \sin \theta $$

The equation of motion for this 2nd-order ordinary differential equation (ODE) is:

$$\ddot{\theta}+\frac{3g}{2L}\sin\theta=0$$

For small angles of displacement, we have:$$\ddot{\theta}+\frac{3g}{2L}\theta=0$$

Using the standard form $$\ddot{\theta}+2\zeta \omega_n \dot\theta +\omega_n ^2 \theta=0 $$ for 2nd-order ODEs, we can determine the natural frequency (rad/s) for small angles to be the following:

$$\omega_n=\sqrt{\frac{3g}{2L}}$$

For small angles, we can also write and verify a hypothetical solution of the form: $$\theta=A\sin(\omega t+\phi)$$

where $$A$$ is an amplitude, $$t$$ is time, and $$\phi$$ is a phase angle. Substituting this hypothetical solution into the equation of motion for small angles, we can also determine the natural frequency $$\omega_n$$ while also determining responses to initial conditions for initial conditions.

For example, for an initial small angle $$\theta_0$$ with zero initial velocity at $$t=0$$, we have the following:

$$\theta=\theta_0 \sin (\omega_n t + \pi/2)$$

If we want to know the angular velocity or angular acceleration, we have only to differentiate:

$$\dot{\theta}=\theta_0 \omega_n \cos (\omega_n t+\pi/2)$$

$$\ddot{\theta}=-\theta_0 \omega_n^2 \sin (\omega_n t+\pi/2)$$

Use of Denavit and Hartenberg matrices (Copied from Link)
The Denavit and Hartenberg notation gives a standard methodology to write the kinematic equations of a manipulator. This is especially useful for serial manipulators where a matrix is used to represent the pose (position and orientation) of one body with respect to another. See paper1 and paper2.

The position of body $$n$$ with respect to $$n-1$$ may be represented by a position matrix indicated with the symbol $$ T $$ or $$ M $$
 * $$  \operatorname{}^{n} _{n-1} T= M_{n-1,n} $$

This matrix is also used to transform a point from frame $$n$$ to $$n-1$$


 * $$  M_{n-1,n} =  \left[ \begin{array}{ccc|c} R_{xx} & R_{xy} & R_{xz} & T_x \\ R_{yx} & R_{yy} & R_{yz} & T_y \\ R_{zx} & R_{zy} & R_{zz} & T_z \\

\hline 0 & 0 & 0 & 1 \end{array}\right] $$ Where the upper left $$3\times 3$$ submatrix of $$M$$ represents the relative orientation of the two bodies, and the upper right $$3\times 1$$ represents their relative position or more specifically the body position in frame n − 1 represented with element of frame n.

The position of body $$k$$ with respect to body $$i$$ can be obtained as the product of the matrices representing the pose of $$j$$ with respect of $$i$$ and that of $$k$$ with respect of $$j$$


 * $$ M_{i,k}= M_{i,j} M_{j,k} $$

An important property of Denavit and Hartenberg matrices is that the inverse is
 * $$  M^{-1} =

\left[ \begin{array}{ccc|c} & &  &  \\     & R^T &  & -R^T T \\ & & &  \\    \hline 0 & 0 & 0 & 1 \end{array} \right] $$ where $$ R^T $$ is both the transpose and the inverse of the orthogonal matrix $$ R $$, i.e. $$ R^{-1}_{ij}=R^T_{ij} = R_{ji} $$.

Further matrices can be defined to represent velocity and acceleration of bodies. The velocity of body $$i$$ with respect to body $$j$$ can be represented in frame $$k$$ by the matrix
 * $$ W_{i,j(k)}=\left[ \begin{array}{ccc|c} 0 & -\omega_z & \omega_y & v_x \\ \omega_z & 0 & -\omega_x & v_y \\ -\omega_y & \omega_x & 0 & v_z \\

\hline 0 & 0 & 0 & 0 \end{array}\right]$$ where $$ \omega $$ is the angular velocity of body $$ j $$ with respect to body $$ i $$ and all the components are expressed in frame $$ k $$; $$ v $$ is the velocity of one point of body $$ j $$ with respect to body $$ i $$ (the pole). The pole is the point of $$ j $$ passing through the origin of frame $$i$$.

The acceleration matrix can be defined as the sum of the time derivative of the velocity plus the velocity squared
 * $$ H_{i,j(k)}=\dot{W}_{i,j(k)}+W_{i,j(k)}^2 $$

The velocity and the acceleration in frame $$ i $$ of a point of body $$ j $$ can be evaluated as
 * $$\dot{P} = W_{i,j} P $$
 * $$\ddot{P} = H_{i,j} P $$

It is also possible to prove that


 * $$\dot{M}_{i,j} = W_{i,j(i)} M_{i,j} $$


 * $$\ddot{M}_{i,j} = H_{i,j(i)} M_{i,j} $$

Velocity and acceleration matrices add up according to the following rules


 * $$ W_{i,k}= W_{i,j} + W_{j,k} $$


 * $$ H_{i,k}= H_{i,j} + H_{j,k} + 2W_{i,j} W_{j,k}$$

in other words the absolute velocity is the sum of the parent velocity plus the relative velocity; for the acceleration the Coriolis' term is also present.

The components of velocity and acceleration matrices are expressed in an arbitrary frame $$k$$ and transform from one frame to another by the following rule


 * $$ W_{(h)}=M_{h,k} W_{(k)} M_{k,h} $$
 * $$ H_{(h)}=M_{h,k} H_{(k)} M_{k,h} $$

For the dynamics three further matrices are necessary to describe the inertia $$ J $$, the linear and angular momentum $$ \Gamma $$, and the forces and torques $$ \Phi $$ applied to a body.

Inertia $$ J $$:


 * $$ J=\left[ \begin{array}{ccc|c} I_{xx} & I_{xy} & I_{xz}  & x_g m \\ I_{yx}  & I_{yy}  &

I_{yz} & y_g m \\ I_{zx}  & I_{zy}  & I_{zz}  & z_g m \\ \hline x_g m & y_g m & z_g m & m \end{array}\right] $$

where $$ m $$ is the mass, $$ x_g,\, y_g,\, z_g $$ represent the position of the center of mass, and the terms $$ I_{xx},\,I_{xy},\ldots$$ represent inertia and are defined as
 * $$ I_{xx} =\iint x^2 \, dm $$



\begin{align} I_{xy} & =\iint xy \, dm \\ I_{xz} & = \cdots \\ & \,\,\, \vdots \end{align} $$

Action matrix $$\Phi$$, containing force $$ f $$ and torque $$ t $$:
 * $$ \Phi = \left[ \begin{array}{ccc|c} 0 & -t_z & t_y & f_x \\ t_z & 0 & -t_x & f_y \\ -t_y & t_x & 0 & f_z \\

\hline -f_x & -f_y & -f_z & 0 \end{array}\right]$$

Momentum matrix $$\Gamma$$, containing linear $$ \rho $$ and angular $$ \gamma $$ momentum
 * $$ \Gamma = \left[ \begin{array}{ccc|c} 0 & -\gamma_z & \gamma_y & \rho_x \\ \gamma_z & 0 & -\gamma_x & \rho_y \\ -\gamma_y & \gamma_x & 0 & \rho_z \\

\hline -\rho_x & -\rho_y & -\rho_z & 0 \end{array}\right]$$

All the matrices are represented with the vector components in a certain frame $$k$$. Transformation of the components from frame $$ k $$ to frame $$ h $$ follows the rule



\begin{align} J_{(h)} & = M_{h,k} J_{(k)} M_{h,k}^T \\ \Gamma_{(h)} & = M_{h,k} \Gamma_{(k)} M_{h,k}^T \\ \Phi_{(h)} & = M_{h,k} \Phi_{(k)} M_{h,k}^T \end{align} $$

The matrices described allow the writing of the dynamic equations in a concise way.

Newton's law:
 * $$ \Phi_{k(0)} = H_{0,k} J_{k(0)} - J_{k(0)} H_{0,k}^T \, $$

Momentum:
 * $$ \Gamma_{k} = W_{k} J_{k} - J_{k} W_{k}^T \, $$

The first of these equations express the Newton's law and is the equivalent of the vector equation $$ f = m a $$ (force equal mass times acceleration) plus $$ t = J \dot{\omega} + \omega \times J \omega $$ (angular acceleration in function of inertia and angular velocity); the second equation permits the evaluation of the linear and angular momentum when velocity and inertia are known.

Denavit and Hartenberg Matrices Applied to a Single Pendulum
For a single pendulum, we can write out the D-H transformation matrix is as follows:$$^1_0 T = M_{0,1} \left[ \begin{array}{ccc|c} \cos\theta_1 & -\sin\theta_1 & 0 & a_1 \cos\theta_1 \\ \sin\theta_1 & \cos\theta_1 & 0 & a_1 \sin\theta_1 \\ 0 & 0 & 1 & 0 \\   \hline 0 & 0 & 0 & 1 \end{array} \right] $$

where "body" 0 is the ground reference frame and body 1 is link 1.

The velocity matrix of body 1 with respect to the ground reference frame is:

$$W_{0,1(0)} = \left[ \begin{array}{ccc|c} 0 & -\dot\theta_1 & 0 & -\dot\theta_1 a_1 \sin\theta_1 \\ \dot\theta_1 & 0 & 0 & \dot\theta_1 a_1 \cos\theta_1 \\ 0 & 0 & 0 & 0 \\   \hline 0 & 0 & 0 & 0 \end{array} \right] $$

The acceleration matrix of body 1 with respect to the ground reference frame becomes:

$$H_{0,1(0)} =\dot W_{0,1(0)}+ W^2_{0,1(0)} = \left[ \begin{array}{ccc|c} 0 & -\ddot\theta_1 & 0 & 0 \\ \ddot\theta_1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\   \hline 0 & 0 & 0 & 0 \end{array} \right] + \left[ \begin{array}{ccc|c} -\dot\theta_1 ^2 & 0 & 0 & 0 \\ 0 & -\dot\theta_1 ^2 & 0 & 0 \\ 0 & 0 & 0 & 0 \\   \hline 0 & 0 & 0 & 0 \end{array} \right] $$

We can describe the inertia $$J_1 $$ with the following matrix:

$$ J_{1(1)}=\left[ \begin{array}{ccc|c} 0 & 0  & 0  & -\frac{1}{2}mL\ \\ 0  & 0  & 0 & 0 \\ 0  & 0  & \frac{1}{12}mL^2  & 0 \\ \hline -\frac{1}{2}mL\ & 0 & 0 & m \end{array}\right] $$

We can express an action matrix $$ \Phi_1 $$:

$$ \Phi_{1(1)}=\left[ \begin{array}{ccc|c} 0 & 0  & 0  & -F_{base} \ \\ 0  & 0  & 0 & -mg\sin\theta_1 \\ 0  & 0  & 0  & 0 \\ \hline F_{base} & mg\sin\theta_1 & 0 & 0 \end{array}\right] $$

where $$ F_{base}=\frac{1}{2}mL\dot\theta_1^2-mg\cos\theta_1 $$ to account for both the centripetal acceleration of the rod and the weight of the bar.

Using Newton's Law in the form $$ \Phi_{k(0)} = H_{0,k} J_{k(0)} - J_{k(0)} H_{0,k}^T \, $$, we should arrive at the following:

== Double Pendulum as a Model System (Pasted Material ) == In physics and mathematics, in the area of dynamical systems, a double pendulum is a pendulum with another pendulum attached to its end, and is a simple physical system that exhibits rich dynamic behavior with a strong sensitivity to initial conditions. The motion of a double pendulum is governed by a set of coupled ordinary differential equations and is chaotic.

Analysis and interpretation
Several variants of the double pendulum may be considered; the two limbs may be of equal or unequal lengths and masses, they may be simple pendulums or compound pendulums (also called complex pendulums) and the motion may be in three dimensions or restricted to the vertical plane. In the following analysis, the limbs are taken to be identical compound pendulums of length $l$ and mass $m$, and the motion is restricted to two dimensions.



In a compound pendulum, the mass is distributed along its length. If the mass is evenly distributed, then the center of mass of each limb is at its midpoint, and the limb has a moment of inertia of $I = 1⁄12ml^{2}$ about that point.

It is convenient to use the angles between each limb and the vertical as the generalized coordinates defining the configuration of the system. These angles are denoted $I = 1⁄3ml^{2}$ and $θ_{1}$. The position of the center of mass of each rod may be written in terms of these two coordinates. If the origin of the Cartesian coordinate system is taken to be at the point of suspension of the first pendulum, then the center of mass of this pendulum is at:
 * $$\begin{align}

x_1 &= \frac{l}{2} \sin \theta_1 \\ y_1 &= -\frac{l}{2} \cos \theta_1 \end{align}$$ and the center of mass of the second pendulum is at
 * $$\begin{align}

x_2 &= l \left ( \sin \theta_1 + \tfrac{1}{2} \sin \theta_2 \right ) \\ y_2 &= -l \left ( \cos \theta_1 + \tfrac{1}{2} \cos \theta_2 \right ) \end{align}$$ This is enough information to write out the Lagrangian.

Lagrangian
The Lagrangian is

\begin{align}L & = \text{kinetic energy} - \text{potential energy} \\ & = \tfrac{1}{2} m \left ( v_1^2 + v_2^2 \right ) + \tfrac{1}{2} I \left ( {\dot \theta_1}^2 + {\dot \theta_2}^2 \right ) - m g \left ( y_1 + y_2 \right ) \\ & = \tfrac{1}{2} m \left ( {\dot x_1}^2 + {\dot y_1}^2 + {\dot x_2}^2 + {\dot y_2}^2 \right ) + \tfrac{1}{2} I \left ( {\dot \theta_1}^2 + {\dot \theta_2}^2 \right ) - m g \left ( y_1 + y_2 \right ) \end{align} $$ The first term is the linear kinetic energy of the center of mass of the bodies and the second term is the rotational kinetic energy around the center of mass of each rod. The last term is the potential energy of the bodies in a uniform gravitational field. The dot-notation indicates the time derivative of the variable in question.

Substituting the coordinates above and rearranging the equation gives

L = \tfrac{1}{6} m l^2 \left ( {\dot \theta_2}^2 + 4 {\dot \theta_1}^2 + 3 {\dot \theta_1} {\dot \theta_2} \cos (\theta_1-\theta_2) \right ) + \tfrac{1}{2} m g l \left ( 3 \cos \theta_1 + \cos \theta_2 \right ). $$ There is only one conserved quantity (the energy), and no conserved momenta. The two momenta may be written as


 * $$\begin{align}

p_{\theta_1} &= \frac{\partial L}{\partial {\dot \theta_1}} = \tfrac{1}{6} m l^2 \left ( 8 {\dot \theta_1} + 3 {\dot \theta_2} \cos (\theta_1-\theta_2) \right ) \\ p_{\theta_2} &= \frac{\partial L}{\partial {\dot \theta_2}} = \tfrac{1}{6} m l^2 \left ( 2 {\dot \theta_2} + 3 {\dot \theta_1} \cos (\theta_1-\theta_2) \right ). \end{align}$$

These expressions may be inverted to get


 * $$\begin{align}

{\dot \theta_1} &= \frac{6}{ml^2} \frac{ 2 p_{\theta_1} - 3 \cos(\theta_1-\theta_2) p_{\theta_2}}{16 - 9 \cos^2(\theta_1-\theta_2)} \\ {\dot \theta_2} &= \frac{6}{ml^2} \frac{ 8 p_{\theta_2} - 3 \cos(\theta_1-\theta_2) p_{\theta_1}}{16 - 9 \cos^2(\theta_1-\theta_2)}. \end{align}$$

The remaining equations of motion are written as


 * $$\begin{align}

{\dot p_{\theta_1}} &= \frac{\partial L}{\partial \theta_1} = -\tfrac{1}{2} m l^2 \left ( {\dot \theta_1} {\dot \theta_2} \sin (\theta_1-\theta_2) + 3 \frac{g}{l} \sin \theta_1 \right ) \\ {\dot p_{\theta_2}} &= \frac{\partial L}{\partial \theta_2} = -\tfrac{1}{2} m l^2 \left ( -{\dot \theta_1} {\dot \theta_2} \sin (\theta_1-\theta_2) + \frac{g}{l} \sin \theta_2 \right ). \end{align}$$

These last four equations are explicit formulas for the time evolution of the system given its current state. It is not possible to go further and integrate these equations analytically, to get formulas for $θ_{2}$ and $θ_{1}$ as functions of time. It is, however, possible to perform this integration numerically using the Runge Kutta method or similar techniques.

Chaotic motion


The double pendulum undergoes chaotic motion, and shows a sensitive dependence on initial conditions. The image to the right shows the amount of elapsed time before the pendulum flips over, as a function of initial position when released at rest. Here, the initial value of $θ_{2}$ ranges along the $x$-direction from −3 to 3. The initial value $θ_{1}$ ranges along the $y$-direction, from −3 to 3. The colour of each pixel indicates whether either pendulum flips within:
 * $θ_{2}$ (green)
 * $10√l/g$ (red)
 * $100√l/g$ (purple) or
 * $1000√l/g$ (blue).

Initial conditions that do not lead to a flip within $10000√l/g$ are plotted white.

The boundary of the central white region is defined in part by energy conservation with the following curve:


 * $$3 \cos \theta_1 + \cos \theta_2 = 2. $$

Within the region defined by this curve, that is if


 * $$3 \cos \theta_1 + \cos \theta_2 > 2, $$

then it is energetically impossible for either pendulum to flip. Outside this region, the pendulum can flip, but it is a complex question to determine when it will flip. Similar behavior is observed for a double pendulum composed of two point masses rather than two rods with distributed mass.

The lack of a natural excitation frequency has led to the use of double pendulum systems in seismic resistance designs in buildings, where the building itself is the primary inverted pendulum, and a secondary mass is connected to complete the double pendulum.

Matrices for Inertia, Momentum, and Loading
For the dynamics three further matrices are necessary to describe the inertia $$ J $$, the linear and angular momentum $$ \Gamma $$, and the forces and torques $$ \Phi $$ applied to a body.

Inertia $$ J $$:


 * $$ J=\left[ \begin{array}{ccc|c} I_{xx} & I_{xy} & I_{xz}  & x_g m \\ I_{yx}  & I_{yy}  &

I_{yz} & y_g m \\ I_{zx}  & I_{zy}  & I_{zz}  & z_g m \\ \hline x_g m & y_g m & z_g m & m \end{array}\right] $$

where $$ m $$ is the mass, $$ x_g,\, y_g,\, z_g $$ represent the position of the center of mass, and the terms $$ I_{xx},\,I_{xy},\ldots$$ represent inertia and are defined as


 * $$ I_{xx} =\iint x^2 \, dm $$



\begin{align} I_{xy} & =\iint xy \, dm \\ I_{xz} & = \cdots \\ & \,\,\, \vdots \end{align} $$

Action matrix $$\Phi$$, containing force $$ f $$ and torque $$ t $$:


 * $$ \Phi = \left[ \begin{array}{ccc|c} 0 & -t_z & t_y & f_x \\ t_z & 0 & -t_x & f_y \\ -t_y & t_x & 0 & f_z \\

\hline -f_x & -f_y & -f_z & 0 \end{array}\right]$$

Momentum matrix $$\Gamma$$, containing linear $$ \rho $$ and angular $$ \gamma $$ momentum


 * $$ \Gamma = \left[ \begin{array}{ccc|c} 0 & -\gamma_z & \gamma_y & \rho_x \\ \gamma_z & 0 & -\gamma_x & \rho_y \\ -\gamma_y & \gamma_x & 0 & \rho_z \\

\hline -\rho_x & -\rho_y & -\rho_z & 0 \end{array}\right]$$

All the matrices are represented with the vector components in a certain frame $$k$$. Transformation of the components from frame $$ k $$ to frame $$ h $$ follows the rule



\begin{align} J_{(h)} & = M_{h,k} J_{(k)} M_{h,k}^T \\ \Gamma_{(h)} & = M_{h,k} \Gamma_{(k)} M_{h,k}^T \\ \Phi_{(h)} & = M_{h,k} \Phi_{(k)} M_{h,k}^T \end{align} $$

The matrices described allow the writing of the dynamic equations in a concise way.

Newton's law:
 * $$ \Phi = H J - J H^t \, $$

Momentum:
 * $$ \Gamma = W J - J W^t \, $$

The first of these equations express the Newton's law and is the equivalent of the vector equation $$ f = m a $$ (force equal mass times acceleration) plus $$ t = J \dot{\omega} + \omega \times J \omega $$ (angular acceleration in function of inertia and angular velocity); the second equation permits the evaluation of the linear and angular momentum when velocity and inertia are known.

Static force analysis (Copied from Link))
The principle of virtual work yields a set of linear equations that relate the resultant force-torque six vector, called a wrench, that acts on the end-effector to the joint torques of the robot. If the end-effector wrench is known, then a direct calculation yields the joint torques.

The inverse statics problem seeks the end-effector wrench associated with a given set of joint torques, and requires the inverse of the Jacobian matrix. As in the case of inverse velocity analysis, at singular configurations this problem cannot be solved. However, near singularities small actuator torques result in a large end-effector wrench. Thus near singularity configurations robots have large mechanical advantage.