\[ \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mv}[1]{\boldsymbol{#1}}\newcommand{\mvinfty}{\boldsymbol{\infty}}\newcommand{\mvzero}{\boldsymbol{0}} \newcommand{\f}[1]{\mathfrak{#1}} \newcommand{\bb}[1]{\mathbb{#1}} \newcommand{\d}[1]{\mathrm{d}#1} \newcommand{\ddt}{\frac{\d{}}{\d{t}}} \newcommand{\pLp}[1]{\frac{\partial L}{\partial #1}} \newcommand{\bm}[1]{\begin{bmatrix}#1\end{bmatrix}} \newcommand{\lagrangian}{F=\ddt\pLp{\dot{q}}-\pLp{q}} \newcommand{\mxi}{\mv{\xi}} \newcommand{\aligned}[1]{\begin{aligned}#1\end{aligned}} \]

Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

L9: Lagrangian Dynamics

Hao Su

Spring, 2021

The flow and some contents are based on ECE5463 taught at Ohio State University by Prof. Wei Zhang

Agenda

click to jump to the section.

Dynamics Example: Grasp

  • Consider the right grasp problem
    • Assume that we are grasping this box using two arms
    • We apply torques at each joint through the installed motors
    • These torques will be passed to the tips of the fingers.
    • ...
Q1: How to compute force at the tips from the torques at joints?
Q2: To keep the box static, what is the balance condition?

Dynamics Example: Grasp

Lagrangian vs. Newton-Euler Methods

Lagrangian Formulation
    • Energy-based method
    • Often used for study of dynamic properties and analysis of control methods
Newton-Euler Formulation
    • Balance of forces/torques
    • Often used for numerical solution of forward/inverse dynamics

Lagrangian Method

Generalized Coordinates and Forces

Generalized Coordinates and Forces

Lagrangian Function

The Principle of Stationary Action

  • Given a pair of time instants, \(t_1\) and \(t_2\)
  • What is the curve \(\mv{q}:[t_1, t_2]\to \cal{C}\) in the generalized coordinate space \(\cal{C}\)?
  • Action is defined to be a functional of \(\mv{q}(t)\): \[ S[\mv{q}]=\int_{t_1}^{t_2} L(q, \dot{q}) \d{t} =\int_{t_1}^{t_2} [T(\mv{q}, \dot{\mv{q}})-V(\mv{q})] \d{t} \]

The Principle of Stationary Action

  • The actual curve \(\mv{q}(t)\) is a stationary point of the \(S[\mv{q}]\): \[ \forall \mv{\delta}:[t_1, t_2]\to \cal{C},\quad \lim_{\epsilon\to 0}\frac{1}{\epsilon}(S[\mv{q}+\epsilon \mv{\delta}]-S [\mv{q}])=0 \tag{1} \]
  • Note: Treating $\mv{q}$ as a variable, and (1) is an extension of the first-order optimality condition that we use in calculus: \[ \nabla_{q}S[q]=0 \]
  • Using variational method, condition (1) becomes \[ \frac{\d{}}{\d{t}}\frac{\partial L}{\partial \dot{q}}-\frac{\partial L}{\partial q}=0 \]

A Simple Example

Euler-Lagrange Equation

Logic behind Concepts in Lagrangian Dynamics

graph TD q["q (gen. coordinate)"] v["q̇ (gen. velocity)"] m["m (gen. inertia)"] T["T (kinetic energy)"] f["F (gen. force)"] P[power] m-->T; q-->T; v-->T; T-->P; dt-->P; q-->v; dt-->v; v--dual-->f; P-->f;

Example: Inverted Pendulum

(describe using spatial frame)

Inverted Pendulum

  • Kinetic energy: $T=\frac{1}{2}m(\dot{\theta} l)^2$
  • Potential energy: $V=mgl \cos\theta$

A schematic drawing of the inverted pendulum. The rod is considered massless.

Generalized Coordinates and Force

  • The generalized coordinate of the system is $\theta$.
  • What is the generalized force?
  • Recall that the inner product of generalized force and generalized velocity is the input power, so we think from the perspective of power
  • Assume the coordinate of $m$ is $(x, y)$, so $P=f \frac{\d{x}}{\d{t}}$
  • If $F$ is a generalized force, then $F \dot{q} = F \frac{\d{\theta}}{\d{t}} = P=f\frac{\d{x}}{\d{t}}$
  • Therefore, $F=f\frac{\d{x}}{\d{\theta}}$
  • But $x=-l\sin\theta$, so $F=-fl\cos\theta$.

A schematic drawing of the inverted pendulum. The rod is considered massless.

Lagrangian Equation

\[ \begin{aligned} L&=T-V=\frac{1}{2}ml^2\dot{\theta}^2-mgl \cos\theta\\ F&=-fl\cos\theta \end{aligned} \]
  • Plug in $\lagrangian$, and we have \[ ml\ddot{\theta}=-f\cos\theta+mg\sin\theta \]
  • In Newton's system, the left is $ma$ and right is the total force tangential to $\vec l$.

A schematic drawing of the inverted pendulum. The rod is considered massless.

Example: Cart Pole

Cart Pole

  • Kinetic energy: $T=\frac{1}{2}M v_1^2+\frac{1}{2}m v_2^2$
  • Assume the joint position is $[x(t), 0]^T$, then
    • $v_1^2=\dot{x}^2$
    • $v_2^2=\left(\ddt{\left(x-\ell \sin \theta \right)}\right)^2+\left(\ddt{\left(\ell \cos \theta \right)}\right)^2$
  • Further computation shows that \[ T={\frac {1}{2}}\left(M+m\right){\dot {x}}^{2}-m\ell {\dot {x}}{\dot {\theta }}\cos \theta +{\frac {1}{2}}m\ell ^{2}{\dot {\theta }}^{2} \]
  • Potential energy: $V=mgl\cos\theta$

A schematic drawing of the inverted pendulum on a cart. The rod is considered massless.
https://en.wikipedia.org/wiki/Inverted_pendulum

Generalized Coordinates and Force

  • First of all, note that there is an external force $F$, and the joint is an Underactuated joint (i.e., no torque at the joint)
  • The generalized coordinates of the system are $q=[x,\theta]^T$, each should have a generalized force.
  • What are the generalized forces?
  • The input power is $P=f\frac{\d{x}}{\d{t}}$
  • Therefore, $[f, 0]^T$ is the generalized force dual to $[x,\theta]^T$

A schematic drawing of the inverted pendulum on a cart. The rod is considered massless.
https://en.wikipedia.org/wiki/Inverted_pendulum

Lagrangian Equation

\[ \aligned{ L&=T-V\\ &={\frac {1}{2}}\left(M+m\right){\dot {x}}^{2}-m\ell {\dot {x}}{\dot {\theta }}\cos \theta +{\frac {1}{2}}m\ell ^{2}{\dot {\theta }}^{2}-mgl\cos\theta\\ F&=[f,0]^T } \]
  • Plug in $\lagrangian$, and we have \[ (M+m)\ddot{x}-ml\cos\theta\ddot{\theta}+ml\sin\theta\dot{\theta}^2=f\\ l\ddot{\theta}-g\sin\theta-\ddot{x}\cos\theta=0 \]

A schematic drawing of the inverted pendulum on a cart. The rod is considered massless.
https://en.wikipedia.org/wiki/Inverted_pendulum

Example: Single-Object Dynamics

Setup

Prep: Derivative of Acceleration

Prep: Derivative of Acceleration

Body-Frame Lagrangian Derivation

Generalized Velocity and Force

Body-Frame Lagrangian Derivation

Body-Frame Lagrangian Derivation

\[ \ddt\pLp{\mv{\xi}^{b(t)}}=\mv{F}^{b(t)},\qquad \pLp{\mv{v}^{b(t)}}=m\mv{v}^{b(t)}, \qquad \pLp{\mv{\omega}^{b(t)}}=\mv{I}^b\mv{\omega}^{b(t)} \]

Spatial-Frame Lagrangian Derivation

Spatial-Frame Lagrangian Derivation

\[ \pLp{\mv{v}^{s(t)}}=m\mv{v}^{s(t)}, \qquad \pLp{\mv{\omega}^{s(t)}}=\mv{I}^b\mv{\omega}^{s(t)} \]

Example: Robot Arm

Robot Arm

Some Notations

For each link $i=1,\ldots,n$, $\cal{F}_i$ is attached to the center of mass of link $i$. All the following quantities are expressed in $\cal{F}_i$

Kinetic and Potential Energies

Lagrangian Equation

Lagrangian Equation