## Real-Time Applications for Multibody System Dynamics

Alberto Luaces - Madison, WI, 2013-07-30

### Ferrol

Ferrol is a city of ~70,000 inhabitants

 Naval tradition Military and civilian shipyards Navy harbor and facilities

### Engineering school: Escola Politécnica Superior, UDC

• Founded in 1992
• Aimed at pushing the naval and industrial tradition of the region
• Grades for naval, mechanical and industrial engineering

### Research: Laboratorio de Ingeniería Mecánica

• Founded in 2002
• Currently 9 people (professors, PhDs, PhD students)
• Research aimed at multibody applications for almost any kind of purpose

## Overview of projects

### Biomechanics: active orthesis design

• Active element to assist the march of spinal-injured people
• The orthesis movement is triggered by a sole sensor.

Where does multibody fit in?

1. Study of the motion: inverse dynamics
2. Computed Torque Control?

### Study of the motion

• Motion is captured by an optical tracking system.
• Force plates register the reactions over each foot.
• Strain gauges on the crutches.

### The orthesis

The movement of each leg is controlled by a motor at the knee

The ankle is controlled by an adjustable spring

### Vehicle simulator

 Fully generic automobile simulation Only 5 bodies, 1ms fixed timestep Open loop, no constraints Relative coordinates Solved as a dense linear system (LAPACK) Runs in real-time platform PXI from NI Labview communication and operation

### Instrumented vehicle

In-house developed vehicle, fully instrumented

• Steering wheel, brake and throttle pedals can be controlled by on-board PC (X-by-wire)
• Current system is able to reproduce straight and J-turn maneuvers

#### Instrumented vehicle: future objectives

• Active research in computing the entire state of the vehicle with a minimum number of sensors.
• Multibody simulator can be used as a virtual sensor
• Kalman filters correcting multibody system in real-time
• ~160 variables
• 5ms fixed timestep
• TMeasy tire model
• Parallelization opportunity: some Kalman implementations require to solve the dynamics within a perturbation field.

### Excavator simulator

 Training simulator Fully 3D articulated model 154 variables Integration timestep 5ms Good performance, but...

• Sequential algorithm, does not scale with CPU cores
• More complex phenomena can not be simulated in real-time
• The system has to be readjusted for optimal size at each instant.

### Anchor Weighing Simulator

• Problem: designing a correct fitting for an anchor into a ship hull
• Aimed at replacing old simulations based on wooden scaled models

### Implementation

 Small system, but too big for CPU: ~60 chain links → ~700 variables index-3 Augmented Lagrangian formulation 0.1ms fixed timestep

### Contact models

• Object surfaces are divided into FEM-like elements.
• Regular chain links are approximated by toroidal and cylindrical shapes.

#### Contact force model: normal force

Hunt-Crossley model

$${\bf F}_{n} ={k_n} \: {\delta}^e \left(1+{\displaystyle \frac{3 \left(1-{\epsilon}\right)}{2} {\frac{\dot{\delta}}{\dot{\delta_0}}}}\right) {\bf n}$$
$$k_n =\frac{4}{3\left(\sigma_{sph}+\sigma_{pln} \right)} \sqrt{R_{sph}}$$ $$\sigma_{sph}=\frac{1-\nu^2_{sph}}{E_{sph}}; \sigma_{pln}=\frac{1-\nu^2_{pln}}{E_{pln}}$$

#### Contact force model: tangential force

$${\bf F}_{t}=\kappa \: {\bf F}_{stic}+(1-\kappa) \: {\bf F}_{slide} - \mu_{visc} {\bf v}_{t}$$
 $${\bf F}_{slide}= \left\{\begin{array}{cl} 0; \ \lVert{\bf v}_{t}\rVert = 0 \\ -{\mu}_{din} \: {\lVert{\bf F}_{n}\rVert} \: {\displaystyle\frac{{\bf v}_{t}}{\lVert{\bf v}_{t}\rVert}}; \ \lVert{\bf v}_{t}\rVert > 0 \end{array}\right\}$$ $${\bf F}_{stic}= \left\{\begin{array}{cl} 0; \ s = 0 \\ \displaystyle {\frac{f^{m}_{stic}}{s}} {\left( {\bf I}_3- {\bf n} {\bf n}^{\rm T} \right)} \: {\left({\bf p}_{contact}-{\bf p}_{stic} \right)}; \ s > 0 \\ \end{array}\right\}$$ $${\bf v}_{t} = \dot{{\bf p}}_{contact}- \left( {\bf n}^{\rm T} \, \dot{{\bf p}}_{contact} \right) {\bf n}$$ $$\kappa=\left\{\begin{array}{cl} 0; & \ \lVert{\bf v}_{t}\rVert >> {v_{stic}} \\1; & \ \lVert{\bf v}_{t}\rVert = 0 \end{array}\right\}$$ $$\kappa={\rm e}^{-\left( {\bf v}^{\rm T}_{t} {\bf v}_{t} \right)/ v^2_{stic}}$$

### Bottleneck

Tools as Intel's VTune or linux's perf can be used to locate the hotspots:

Most of the time is spent on solving the linear system at each iteration.

### Linear System

The linear system to be solved in each Newton-Raphson iteration is

$${\left[ {\frac{{\partial f\left( {\bf q} \right)}}{{\partial {\bf q}}}} \right]_i}\Delta {{\bf q}_{i + 1}} = - {\left[ {f\left( {\bf q} \right)} \right]_i}$$

where

$$f({\bf q}) = \beta {h^2} \bigl\{ {\bf M}\left[ \left( {1 - {\delta_m}} \right) {\bf \ddot q}_{n + 1} + {\delta_m} {\bf \ddot q}_n \right] \bigr. + \\ + \bigl. \left( {1 - {\delta_f}} \right) \left[{ \Phi}_{\bf q}^{\rm T} \left( \alpha { \Phi} + {{\lambda }}^{\ast} \right) - {\bf Q} \right]_{n + 1} + \\ + {\delta_f} \left[{ \Phi}_{\bf q}^{\rm T} \left( \alpha { \Phi} + {{\lambda}}^{\ast} \right) - {\bf Q} \right]_n \bigr\}$$

### Tangent Matrix

$$\left[ {\frac{{\partial f\left( {\bf q} \right)}}{{\partial {\bf q}}}} \right] \cong \left( {1 - {\delta _m}} \right){\bf M} + \left( {1 - {\delta _f}} \right)\gamma h{{\bf C}_{n + 1}} + \\ + \left( {1 - {\delta _f}} \right)\beta {h^2} \left( {{ \Phi} _{\bf q}^{\rm T} { \alpha} { \Phi} _{\bf q} + {\bf K}} \right)_{n + 1}$$
where $${\bf K} = {\frac{{\partial {\bf Q}}}{{\partial {\bf q}}}}$$ and $${\bf C} = {\frac{{\partial {\bf Q}}}{{\partial {\bf \dot q}}}}$$
• Fill rate: around 2%
• It is not required to compute this matrix for each iteration.

### Embedded computing platforms

 ARM low-powered devices (portable) Small but still useful computing power Some of them multicore Capability of easily driving external hardware