Table of Contents
Fetching ...

ServoLNN: Lagrangian Neural Networks Driven by Servomechanisms

Brandon Johns, Zhuomin Zhou, Elahe Abdi

TL;DR

ServoLNN extends Lagrangian neural networks by introducing externally specified generalised coordinates to model systems driven by servomechanisms. The architecture outputs a potential energy $\\mathcal{V}(\\mathbf{q})$ and constructs a mass matrix $\\mathbf{M}(\\mathbf{q})$ via a Cholesky-like factorization, enforcing physical consistency and positive definiteness. Reformulated Euler–Lagrange equations with partitioned coordinates yield forward/inverse dynamics, energies, power, and the forces driving the servomechanisms, including an explicit expression for the equivalent driving force $\\mathbf{Q}_e$. Evaluation on a crane-cart pendulum dataset demonstrates real-time inference (~1.7 ms per sample) and accurate recovery of dynamic quantities when $\\mathbf{Q}_e$ is known, while highlighting a family of solutions in its absence and proposing methods to resolve it by incorporating $\\mathbf{Q}_e$ during training.

Abstract

Combining deep learning with classical physics facilitates the efficient creation of accurate dynamical models. In a recent class of neural network, Lagrangian mechanics is hard-coded into the architecture, and training the network learns the given system. However, the current architectures do not facilitate the modelling of dynamical systems that are driven by servomechanisms (e.g. servomotors, stepper motors, current sources, volumetric pumps). This article presents ServoLNN, a new architecture to model dynamical systems that are driven by servomechanisms. ServoLNN is compatible for use in real-time applications, where the driving motion is known only just-in-time. A PyTorch implementation of ServoLNN is provided. The derivations and results reveal the occurrence of a possible family of solutions that the training may converge on. The effect of the family of solutions on the predicted physical quantities is explored, as is the resolution to reduce the family of solutions to a single solution. Resultantly, the architecture can simultaneously accurately find the energies, power, rate of work, mass matrix, generalised accelerations, generalised forces, and the generalised forces that drive the servomechanisms.

ServoLNN: Lagrangian Neural Networks Driven by Servomechanisms

TL;DR

ServoLNN extends Lagrangian neural networks by introducing externally specified generalised coordinates to model systems driven by servomechanisms. The architecture outputs a potential energy and constructs a mass matrix via a Cholesky-like factorization, enforcing physical consistency and positive definiteness. Reformulated Euler–Lagrange equations with partitioned coordinates yield forward/inverse dynamics, energies, power, and the forces driving the servomechanisms, including an explicit expression for the equivalent driving force . Evaluation on a crane-cart pendulum dataset demonstrates real-time inference (~1.7 ms per sample) and accurate recovery of dynamic quantities when is known, while highlighting a family of solutions in its absence and proposing methods to resolve it by incorporating during training.

Abstract

Combining deep learning with classical physics facilitates the efficient creation of accurate dynamical models. In a recent class of neural network, Lagrangian mechanics is hard-coded into the architecture, and training the network learns the given system. However, the current architectures do not facilitate the modelling of dynamical systems that are driven by servomechanisms (e.g. servomotors, stepper motors, current sources, volumetric pumps). This article presents ServoLNN, a new architecture to model dynamical systems that are driven by servomechanisms. ServoLNN is compatible for use in real-time applications, where the driving motion is known only just-in-time. A PyTorch implementation of ServoLNN is provided. The derivations and results reveal the occurrence of a possible family of solutions that the training may converge on. The effect of the family of solutions on the predicted physical quantities is explored, as is the resolution to reduce the family of solutions to a single solution. Resultantly, the architecture can simultaneously accurately find the energies, power, rate of work, mass matrix, generalised accelerations, generalised forces, and the generalised forces that drive the servomechanisms.

Paper Structure

This paper contains 16 sections, 37 equations, 8 figures.

Figures (8)

  • Figure 1: Diagram of ServoLNN. A more detailed representation is Figure \ref{['fig:NN-diagram']}. $\text{NN}(\mathbf{q})$ is the neural network, $\mathbf{q}$ are the generalised coordinates, and $\mathbf{Q}$ are the generalised forces.
  • Figure 2: Diagram of ServoLNN. The depicted structure, as well as the mathematical symbols and equations, are introduced in Section \ref{['sec:theory']} and Section \ref{['ssec:nn']}. $\text{NN}(\mathbf{q})$ represents the multiheaded neural network.
  • Figure 3: Diagram of the tested dynamical system.
  • Figure 4: Trajectories of the externally specified generalised coordinate used during training and testing. Each curve represents a different trial. Units in meters.
  • Figure 5: Total loss during training for each method. Both cases used the same random seed of 42.
  • ...and 3 more figures