Development of a MARTe2 Application - Mass-spring-damper

In this section, you will develop your first MARTe2 application based on a mass-spring-damper example.

The mass-spring-damper system is a fundamental mechanical system that consists of a mass (\(m\)) attached to a spring with stiffness (\(k\)) and a damper with damping coefficient (\(c\)). The system is subjected to an external force (\(F\)) and can be described by the following second-order ordinary differential equation:

\[m \ddot{x} + c \dot{x} + k x = F\]

Where:

  • \(x\) is the displacement of the mass from its equilibrium position.

  • \(\dot{x}\) is the velocity of the mass.

  • \(\ddot{x}\) is the acceleration of the mass.

  • \(F\) is the external force applied to the mass.

  • \(m\) is the mass.

  • \(c\) is the damping coefficient.

  • \(k\) is the spring stiffness.

Mass-spring-damper system

Schematic representation of the mass-spring-damper system. The goal is to control the displacement (x) of the mass by adjusting the external force (F) applied to it.

The main objective of this tutorial is to identify and integrate existing MARTe2 components that can be used to implement a controller for the mass-spring-damper system, including features that facilitate the debugging and monitoring of the system.

It will start by introducing GAMs from the MARTe2-components repository to implement common features, followed by sections dedicated to DataSources and Interfaces.